سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top