PDA

View Full Version : Hide Title bar in Qt Quick Application



nikhil.patil2010
17th March 2014, 10:15
I need to hide the title bar of my application. I tried


setWindowFlags(Qt::Window | Qt::FramelessWindowHint);

in main.cpp.. But i got the error "C:\Qt\Qt5.2.1\Tools\QtCreator\bin\PSC\main.cpp:13: error: C2039: 'setWindowFlags' : is not a member of 'QtQuick2ApplicationViewer'"

xervith
17th March 2014, 10:29
Hi.
Just add Qt::FramelessWindowHint to mainwindow.cpp
Example:




MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent,Qt::FramelessWindowHint),
ui(new Ui::MainWindow)
{
ui->setupUi(this);


that works for me without any problems.

Greets
xer

anda_skoa
17th March 2014, 10:35
Follow the class ancestor chain, check the documentation until you find the flags property.
Bonus hint: QWindow

Cheers,
_