Reputation: 11671
I currently have a form that inherits from QDialog.
Now in order to hide the ?
icon on the form I am doing something like this in the constructor.
foo::foo(QWidget *parent): QDialog(parent)
{
.....
this->setWindowFlags(Qt::WindowTitleHint);
}
The problem with this is that the Dialog does not show up. If I ommit the flags line it shows up. I am using QT 5.1.1
Upvotes: 3
Views: 2362
Reputation: 890
To answer the question, here the solution:
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
If you want the minimize and maximize options, do the following:
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint) | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint);
Upvotes: 2
Reputation: 101
To get this to work on linux I had to use both options described above:
setFixedSize(width(), height());
setWindowFlags(Qt::Drawer);
The result is a dialog with only a close button.
Upvotes: 0
Reputation: 4029
Eventually you want to call
this->setWindowFlags(this->windowFlags() | Qt::WindowTitleHint);
Upvotes: 1