PDA

View Full Version : Show maximize button in the title bar of a QDialog under GNOME



lalesculiviu
24th June 2010, 15:02
Hello!

I need to show the maximize (and minimize) buttons in the title bar of a QDialog. I made this:


dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowMinMaxButtonsHint);

which I call for the QDialog* dialog.

Under KDE and Windows, the min max buttons are shown and working. Under GNOME, the buttons are not shown (I only see the close button).

How can I solve this? Is it safe to do:


dialog->setWindowFlags(Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);

(this works, practically, under GNOME)

so that the flags for this dialog will not contain Qt::Dialog anymore, but will contain Qt::Window?

I tried also setting Qt::CustomizeWindowHint under GNOME, but it does not work.

I also found this link to a similar problem: http://www.archivum.info/qt-interest@trolltech.com/2009-07/00011/%5BQt-interest%5D-Maximize-button-for-dialogs-on-Gnome--Metacity.html

Thank you!

lalesculiviu
25th June 2010, 07:46
I have another question: what is the reason/explanation of Qt::CustomizeWindowHint? Practically, it seems that it is not necessary to set this, even if I am customizing, by adding minmax buttons hint (minmax buttons are added even without setting Qt::CustomizeWindowHint).