Remove minimize button from QDialog
Hi all,
I’m working in a Linux application.
I need to remove minimize button from a QDialog. I tried some solution without success.
The only one solution that works is:
- parametri_dialog->show();
but this way all button disappear and I also can’t resize dialog.
If I put the line:
- parametri_dialog->setWindowFlags(parametri_dialog->windowFlags() & ~(Qt::WindowMinimizeButtonHint));
nothing happend.
Can you help me?
7 replies
From Qt::WindowFlags docs [doc.qt.nokia.com]
The CustomizeWindowHint flag is used to enable customization of the window controls. This flag must be set to allow the WindowTitleHint, WindowSystemMenuHint, WindowMinimizeButtonHint, WindowMaximizeButtonHint and WindowCloseButtonHint flags to be changed.
So you should also set the Qt::CustomizeWindowHint flag.
This works for me:
- #include <QApplication>
- #include <QDialog>
- int main(int argc, char *argv[])
- {
- a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
- QDialog d;
- d.setWindowTitle("abcd");
- d.show();
- return a.exec();
- }
You might set some other window flags too.
You must log in to post a reply. Not a member yet? Register here!




