从这里开始:http://doc.qt.io/qt-4.8/qt-widgets-windowflags-example.html
该示例演示了如何使用Qt窗口标志控制窗口的行为和外观。通过设置不同的标志,可以禁用关闭按钮、更改窗口标题栏和窗口大小等。此示例代码是用C++编写的,并且使用Qt库。
但是当我这样做的时候:
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";
但是当我这样做的时候:
Qt :: WindowFlags flags = 0;
flags = flags | Qt :: WindowStaysOnTopHint;
flags = flags & Qt :: WindowMinimizeButtonHint;
window->setWindowFlags (flags);
第一个标记被覆盖了。如何一次设置多个标记?