diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2011-05-26 11:56:54 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2011-05-26 14:21:20 (GMT) |
commit | 6c10e72fc838f8f9f5c3a3e4a297088b1725262c (patch) | |
tree | 4ef2188f5d2320e8b1a275f63b8cb4b33bf25a09 /tests | |
parent | 4a7b3a10da5b3bd63b6f8a6c0cc53ee22c60fe60 (diff) | |
download | Qt-6c10e72fc838f8f9f5c3a3e4a297088b1725262c.zip Qt-6c10e72fc838f8f9f5c3a3e4a297088b1725262c.tar.gz Qt-6c10e72fc838f8f9f5c3a3e4a297088b1725262c.tar.bz2 |
Fix infinite recursion when changing geometry on Mac
Some complex widgets might get a negatively sized rectangle when
calling QWidgetPrivate:setGeometry_sys_helper(), triggering a infinite
recursion. Normalizing the rectangle size before checking for size
change is enough to break this infinite recursion.
Reviewed-by: Richard
Task-number: QTBUG-17333
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index f85d469..43dd077 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -71,6 +71,7 @@ #include <QtGui/qpaintengine.h> #include <private/qbackingstore_p.h> #include <qmenubar.h> +#include <qtableview.h> #include <QtGui/QGraphicsView> #include <QtGui/QGraphicsProxyWidget> @@ -406,6 +407,7 @@ private slots: void childAt(); #ifdef Q_WS_MAC void childAt_unifiedToolBar(); + void taskQTBUG_17333_ResizeInfiniteRecursion(); #ifdef QT_MAC_USE_COCOA void taskQTBUG_11373(); #endif // QT_MAC_USE_COCOA @@ -10593,6 +10595,18 @@ void tst_QWidget::childAt_unifiedToolBar() QCOMPARE(mainWindow.childAt(labelTopLeft), static_cast<QWidget *>(label)); } +void tst_QWidget::taskQTBUG_17333_ResizeInfiniteRecursion() +{ + QTableView tb; + const char *s = "border: 1px solid;"; + tb.setStyleSheet(s); + tb.show(); + + QTest::qWaitForWindowShown(&tb); + tb.setGeometry(QRect(100, 100, 0, 100)); + // No crash, it works. +} + #ifdef QT_MAC_USE_COCOA void tst_QWidget::taskQTBUG_11373() { |