summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-07-15 08:18:02 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-07-15 08:23:00 (GMT)
commit511985fa173daa9b8462dbb72c45a74626e8cba4 (patch)
tree8e07d760e3d0883caacff5571e706241d6a0050e /src/gui/kernel/qwidget_mac.mm
parent9f8b09ad70845fa5e9bc232d9e0de1274e732895 (diff)
downloadQt-511985fa173daa9b8462dbb72c45a74626e8cba4.zip
Qt-511985fa173daa9b8462dbb72c45a74626e8cba4.tar.gz
Qt-511985fa173daa9b8462dbb72c45a74626e8cba4.tar.bz2
Fix for tst_qmdisubwindow::fixedMinMaxSize failure on Cocoa
We need to respect the size restrictions for all QWidgets. Previously this was only applied to top levels. Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index e57ec77..c788711 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -4389,6 +4389,13 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM
data.window_state = data.window_state & ~Qt::WindowMaximized;
const bool visible = q->isVisible();
+ // Apply size restrictions, applicable for Windows & Widgets.
+ if (QWExtra *extra = extraData()) {
+ w = qMin(w, extra->maxw);
+ h = qMin(h, extra->maxh);
+ w = qMax(w, extra->minw);
+ h = qMax(h, extra->minh);
+ }
data.crect = QRect(x, y, w, h);
if (realWindow) {