From here: http://doc.qt.io/qt-4.8/qt-widgets-windowflags-example.html
if (flags & Qt::MSWindowsFixedSizeDialogHint)
text += "\n| Qt::MSWindowsFixedSizeDialogHint";
if (flags & Qt::X11BypassWindowManagerHint)
text += "\n| Qt::X11BypassWindowManagerHint";
if (flags & Qt::FramelessWindowHint)
text += "\n| Qt::FramelessWindowHint";
if (flags & Qt::WindowTitleHint)
text += "\n| Qt::WindowTitleHint";
if (flags & Qt::WindowSystemMenuHint)
text += "\n| Qt::WindowSystemMenuHint";
if (flags & Qt::WindowMinimizeButtonHint)
text += "\n| Qt::WindowMinimizeButtonHint";
if (flags & Qt::WindowMaximizeButtonHint)
text += "\n| Qt::WindowMaximizeButtonHint";
if (flags & Qt::WindowCloseButtonHint)
text += "\n| Qt::WindowCloseButtonHint";
if (flags & Qt::WindowContextHelpButtonHint)
text += "\n| Qt::WindowContextHelpButtonHint";
if (flags & Qt::WindowShadeButtonHint)
text += "\n| Qt::WindowShadeButtonHint";
if (flags & Qt::WindowStaysOnTopHint)
text += "\n| Qt::WindowStaysOnTopHint";
if (flags & Qt::CustomizeWindowHint)
text += "\n| Qt::CustomizeWindowHint";
But when I do this:
Qt :: WindowFlags flags = 0;
flags = flags | Qt :: WindowStaysOnTopHint;
flags = flags & Qt :: WindowMinimizeButtonHint;
window->setWindowFlags (flags);
The first flag gets overwritten. What is the way to set more than one flags at the same time?
window->setWindowFlags (Qt::WindowStaysOnTopHint | Qt::WindowMinimizeButtonHint );
For your information:
Window Flags are stored as OR combinations of the flags inside an object of the type QFlags<WindowType>
where WindowType is an enum.
When storing the flags you combine their values using the bitwise OR operator.
For further information see the Qt documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With