summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-06 09:52:01 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-06 10:00:48 (GMT)
commit69597149e606a3d8a22a2ea7c2964b799751d898 (patch)
treee9b51eea9bd50538cf0e0bd1da2ff79f533ab60c /src/gui
parent552a7cf157da9c8d2b811b3123138b52dde072f7 (diff)
downloadQt-69597149e606a3d8a22a2ea7c2964b799751d898.zip
Qt-69597149e606a3d8a22a2ea7c2964b799751d898.tar.gz
Qt-69597149e606a3d8a22a2ea7c2964b799751d898.tar.bz2
Fixes a regression in qwidget when setting a large minimum size.
Setting a minimum size to a value that is larger then the biggest allowed widget size, we should costrain the widget to that max allowed size as we did before. Change 6a2621b6832dbdd349f77cf1f3242b4a6ba3c740 broke it. Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 50343fc..60a6b7a 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -3480,27 +3480,27 @@ bool QWidgetPrivate::setMinimumSize_helper(int &minw, int &minh)
}
}
#endif
+ int mw = minw, mh = minh;
+ if (mw == QWIDGETSIZE_MAX)
+ mw = 0;
+ if (mh == QWIDGETSIZE_MAX)
+ mh = 0;
if (minw > QWIDGETSIZE_MAX || minh > QWIDGETSIZE_MAX) {
qWarning("QWidget::setMinimumSize: (%s/%s) "
"The largest allowed size is (%d,%d)",
q->objectName().toLocal8Bit().data(), q->metaObject()->className(), QWIDGETSIZE_MAX,
QWIDGETSIZE_MAX);
- minw = qMin<int>(minw, QWIDGETSIZE_MAX);
- minh = qMin<int>(minh, QWIDGETSIZE_MAX);
+ minw = mw = qMin<int>(minw, QWIDGETSIZE_MAX);
+ minh = mh = qMin<int>(minh, QWIDGETSIZE_MAX);
}
if (minw < 0 || minh < 0) {
qWarning("QWidget::setMinimumSize: (%s/%s) Negative sizes (%d,%d) "
"are not possible",
q->objectName().toLocal8Bit().data(), q->metaObject()->className(), minw, minh);
- minw = qMax(minw, 0);
- minh = qMax(minh, 0);
+ minw = mw = qMax(minw, 0);
+ minh = mh = qMax(minh, 0);
}
createExtra();
- int mw = minw, mh = minh;
- if (mw == QWIDGETSIZE_MAX)
- mw = 0;
- if (mh == QWIDGETSIZE_MAX)
- mh = 0;
if (extra->minw == mw && extra->minh == mh)
return false;
extra->minw = mw;