diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-09 16:25:49 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-09 16:25:49 (GMT) |
commit | 963d42fbf1fb68c2bd09b12dedbad000d8001b94 (patch) | |
tree | c1c8cc710fe1e6ebf08f03fa4347b616a574237e /src | |
parent | 0b7a5ebb7c4a65a931d2c69b9d3780cdc6ece893 (diff) | |
download | Qt-963d42fbf1fb68c2bd09b12dedbad000d8001b94.zip Qt-963d42fbf1fb68c2bd09b12dedbad000d8001b94.tar.gz Qt-963d42fbf1fb68c2bd09b12dedbad000d8001b94.tar.bz2 |
Make sure the dock widget is updated when changing closable property
Task-number: QTBUG-1665
Reviewed-by: ogoffart
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qdockwidget.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index a8e2a37..9cf6af1 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1225,6 +1225,7 @@ void QDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features) features &= DockWidgetFeatureMask; if (d->features == features) return; + const bool closableChanged = (d->features ^ features) & DockWidgetClosable; d->features = features; QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(this->layout()); @@ -1233,6 +1234,10 @@ void QDockWidget::setFeatures(QDockWidget::DockWidgetFeatures features) d->toggleViewAction->setEnabled((d->features & DockWidgetClosable) == DockWidgetClosable); emit featuresChanged(d->features); update(); + if (closableChanged && layout->nativeWindowDeco()) { + //this ensures the native decoration is drawn + d->setWindowState(true /*floating*/, true /*unplug*/); + } } QDockWidget::DockWidgetFeatures QDockWidget::features() const |