0

How do I enable all options in the context menu of a QDialog? (Minimize and maximize). I only find help about enabling the window flags, but that's not really necessary.

Dialog menu

Rol
  • 200
  • 1
  • 2
  • 13
  • Why do you say that flags are not helping? If you set the flag `Qt::CustomizeWindowHint`, it will show you Minimize and maximize in the context menu. – IAmInPLS May 06 '16 at 07:47

1 Answers1

1

As you can see in Qt doc, Qt::Dialog flag deactivates Minimize/Maximize options.

To enable it, you need to change window flags using the method:

setWindowFlags(Qt::Window);

What's more, if you want to be able to minimize your dialog box alone you need to add these methods:

setParent(NULL);
setWindowModality(Qt::NonModal);

In fact, your QDialog becomes a QWindow.

double_g
  • 836
  • 7
  • 9
  • Helpful answer. My window was already NonModal. In python the line reads "myapp.setWindowFlags(QtCore.Qt.WindowMinMaxButtonsHint)" – Rol May 06 '16 at 09:56