diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index ace50f13ee..1db9f5d75e 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10357,7 +10357,7 @@ void QWidget::updateGeometry() a window, causing the widget to be hidden. You must call show() to make the widget visible again.. - \sa windowType(), {Window Flags Example} + \sa windowType(), setWindowFlag(), {Window Flags Example} */ void QWidget::setWindowFlags(Qt::WindowFlags flags) { @@ -10365,6 +10365,23 @@ void QWidget::setWindowFlags(Qt::WindowFlags flags) d->setWindowFlags(flags); } +/*! + \since 5.9 + + Sets the window flag \a flag on this widget if \a on is true; + otherwise clears the flag. + + \sa setWindowFlags(), windowFlags(), windowType() +*/ +void QWidget::setWindowFlag(Qt::WindowType flag, bool on) +{ + Q_D(QWidget); + if (on) + d->setWindowFlags(data->window_flags | flag); + else + d->setWindowFlags(data->window_flags & ~flag); +} + /*! \internal Implemented in QWidgetPrivate so that QMdiSubWindowPrivate can reimplement it. |