summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2010-07-15 14:08:43 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2010-10-01 20:07:07 (GMT)
commitb3a46493a1a74bd7918bd68638c28cf6e84eb57f (patch)
treee57bef65a7d5f460b8f5c3e47eeb28be62959d6a /src
parent4cdaadb332a49513d6082b6ea723dc1968b3ad30 (diff)
downloadQt-b3a46493a1a74bd7918bd68638c28cf6e84eb57f.zip
Qt-b3a46493a1a74bd7918bd68638c28cf6e84eb57f.tar.gz
Qt-b3a46493a1a74bd7918bd68638c28cf6e84eb57f.tar.bz2
QWorkspace: fix hardcoded min size overwriting the real min size
The setMinimumSize call was having precedence over the minimumSizeHint, so when having a sizegrip enabled it was possible to resize a MDI window to a much smaller size than its min size (actually it would flicker between the two sizes, on each resize). Fixed by moving that min size (for the titlebar contents) to the calculations in minimumSizeHint(). Reviewed-by: mariusso
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qworkspace.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp
index 7180c4d..3a9b30c 100644
--- a/src/gui/widgets/qworkspace.cpp
+++ b/src/gui/widgets/qworkspace.cpp
@@ -2551,7 +2551,6 @@ QWorkspaceChild::QWorkspaceChild(QWidget* window, QWorkspace *parent, Qt::Window
this, SLOT(titleBarDoubleClicked()));
}
- setMinimumSize(128, 0);
int fw = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this);
setContentsMargins(fw, fw, fw, fw);
@@ -2702,11 +2701,15 @@ QSize QWorkspaceChild::sizeHint() const
QSize QWorkspaceChild::minimumSizeHint() const
{
- if (!childWidget)
- return QWidget::minimumSizeHint() + baseSize();
- QSize s = childWidget->minimumSize();
- if (s.isEmpty())
- s = childWidget->minimumSizeHint();
+ QSize s;
+ if (!childWidget) {
+ s = QWidget::minimumSizeHint();
+ } else {
+ s = childWidget->minimumSize();
+ if (s.isEmpty())
+ s = childWidget->minimumSizeHint();
+ }
+ s = s.expandedTo(QSize(128, 0));
return s + baseSize();
}