From 69597149e606a3d8a22a2ea7c2964b799751d898 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 6 Aug 2009 11:52:01 +0200 Subject: 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 --- src/gui/kernel/qwidget.cpp | 18 +++++++++--------- 1 file 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(minw, QWIDGETSIZE_MAX); - minh = qMin(minh, QWIDGETSIZE_MAX); + minw = mw = qMin(minw, QWIDGETSIZE_MAX); + minh = mh = qMin(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; -- cgit v0.12