3

I'm trying to add a minimize button to my QDialog using this code in the constructor:

Qt::WindowFlags flags = windowFlags();
flags |= Qt::WindowMinMaxButtonsHint;
setWindowFlags(flags);

It's working on Windows but not on Linux.

sashoalm
  • 75,001
  • 122
  • 434
  • 781

1 Answers1

11

Its a late answer but could be useful to others, I had the same problem and fixed like so:

Qt::WindowFlags flags = Qt::Window | Qt::WindowSystemMenuHint
                            | Qt::WindowMinimizeButtonHint
                            | Qt::WindowCloseButtonHint;
this->setWindowFlags(flags);

inside the overridden dialog constructor.

andrea
  • 452
  • 5
  • 14
  • 1
    In the end I switched the project from QDialog to QMainWindow, which solved my problem, but still, thank you for the answer. – sashoalm Jan 25 '11 at 20:02