Qt::WindowFlags flags
时间: 2024-05-06 10:20:52 浏览: 66
Qt::WindowFlags is an enumeration type that represents the various window flags that can be set on a Qt widget. Some of the commonly used flags are:
- Qt::Window: Specifies that the widget is a window.
- Qt::Dialog: Specifies that the widget is a dialog box.
- Qt::FramelessWindowHint: Specifies that the widget has no frame or border.
- Qt::WindowTitleHint: Specifies that the widget displays a title bar.
- Qt::CustomizeWindowHint: Specifies that the widget can be customized by the user.
To set these flags on a widget, you can use the setWindowFlags() function. For example:
```
QWidget* widget = new QWidget();
widget->setWindowFlags(Qt::Window | Qt::WindowTitleHint);
```
This sets the window flag and the title bar flag on the widget.
阅读全文