summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-03-25 15:56:20 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-03-25 15:56:57 (GMT)
commita71e6490b5415f24e38681015ae05326a004a7b7 (patch)
tree886b7dd71510d91d7dba1e9dea464f8dfa2a7b50
parent346efa672ea4045c0621103e956a3d8c47459808 (diff)
downloadQt-a71e6490b5415f24e38681015ae05326a004a7b7.zip
Qt-a71e6490b5415f24e38681015ae05326a004a7b7.tar.gz
Qt-a71e6490b5415f24e38681015ae05326a004a7b7.tar.bz2
Fix layout problem in QMainWindow
QDockWidget's minimum title width was not computed correctly and was thus provoking some strange layout issues. We need to ask for the widget's sizeHint for the close and float buttons. Task-number: 241577 Reviewed-by: ogoffart
-rw-r--r--src/gui/widgets/qdockwidget.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp
index 865b19c..a5be5f8 100644
--- a/src/gui/widgets/qdockwidget.cpp
+++ b/src/gui/widgets/qdockwidget.cpp
@@ -406,10 +406,14 @@ int QDockWidgetLayout::minimumTitleWidth() const
QSize closeSize(0, 0);
QSize floatSize(0, 0);
- if (QLayoutItem *item = item_list[CloseButton])
- closeSize = item->sizeHint();
- if (QLayoutItem *item = item_list[FloatButton])
- floatSize = item->sizeHint();
+ if (hasFeature(q, QDockWidget::DockWidgetClosable)) {
+ if (QLayoutItem *item = item_list[CloseButton])
+ closeSize = item->widget()->sizeHint();
+ }
+ if (hasFeature(q, QDockWidget::DockWidgetFloatable)) {
+ if (QLayoutItem *item = item_list[FloatButton])
+ floatSize = item->widget()->sizeHint();
+ }
int titleHeight = this->titleHeight();