Hi everyone,

I have stumbled on a problem. I have a "Main Window" sub-classed form QMainWindow which updates it minimum size depending on the Widgets that are set onto it.

On a systems with more than 1 monitor, this can mean that the minimum size is larger than the "maximized size", for this case i want to be able to disable the maximize Button on the title-bar until the minimum size is smaller or equal to the maximized size.

With the following code i can get the available size of the Screen (the maximized size):

Qt Code:
  1. QSize screenSize = qApp->desktop()->availableGeometry(qApp->desktop()->screenNumber(this)).size();
To copy to clipboard, switch view to plain text mode 

But for disabling the button on the title-bar i have only found the following:
void QWidget::setWindowFlags(Qt::WindowFlags flags )
void QWidget::overrideWindowFlags ( Qt::WindowFlags flags )
If I use setWindowFlags, then the window will flicker as it gets hidden and must be re-shown.

The override method worked better as it didn't cause any flicker, but it also didn't update the button properly. I am not quite sure which "update" method is needed in this case.

So, does anyone understand what i am talking about?

Thank you for reading..

Eric