Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable maximize button in QWizard

Tags:

I have a Windows application that is built on QWizard (which inherits from QDialog). It must have a working maximization button.

By default maximization button is not even visible. i have set it to show, using:

auto flags = windowFlags();
flags ^= Qt::WindowContextHelpButtonHint;
flags |= Qt::WindowMinMaxButtonsHint;
setWindowFlags(flags);

However, it shows up disabled (grayed out, non-responding).

How can i enable it?

like image 666
Srv19 Avatar asked Feb 04 '15 10:02

Srv19


1 Answers

This works for me:

setWindowFlags(windowFlags() | Qt::CustomizeWindowHint |
                               Qt::WindowMinimizeButtonHint |
                               Qt::WindowMaximizeButtonHint |
                               Qt::WindowCloseButtonHint);

According to the documentation, you have to use the Qt::CustomizeWindowHint to be able to change the individual hints on the min/max buttons.

like image 119
Luiz Vieira Avatar answered Sep 20 '22 02:09

Luiz Vieira