diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-03-25 15:56:20 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-03-25 15:56:57 (GMT) |
commit | a71e6490b5415f24e38681015ae05326a004a7b7 (patch) | |
tree | 886b7dd71510d91d7dba1e9dea464f8dfa2a7b50 | |
parent | 346efa672ea4045c0621103e956a3d8c47459808 (diff) | |
download | Qt-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.cpp | 12 |
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(); |