commit dbea11feacc3a977878eb4fe54c3fcf84907870b Author: Jan-Arve Sæther Date: Tue Feb 23 13:20:11 2010 +0100 Add autotest for QTBUG-5448 diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 3e14b56..ce55e7e 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -392,6 +392,7 @@ private slots: void focusProxyAndInputMethods(); void scrollWithoutBackingStore(); + void updateGeometryShouldInvalidateAllAncestors(); private: bool ensureScreenSize(int width, int height); @@ -9757,5 +9758,23 @@ void tst_QWidget::scrollWithoutBackingStore() QCOMPARE(child.pos(),QPoint(25,25)); } +void tst_QWidget::updateGeometryShouldInvalidateAllAncestors() +{ + QWidget window; + QVBoxLayout *l1 = new QVBoxLayout(&window); + l1->setMargin(0); + QVBoxLayout *l2 = new QVBoxLayout; + l1->addLayout(l2); + QLabel *label = new QLabel(&window); + l2->addWidget(label); + window.show(); + QTest::qWaitForWindowShown(&window); + qApp->sendPostedEvents(); + QCOMPARE(l1->sizeHint(), label->sizeHint()); + + label->setText(QLatin1String("should trigger updateGeometry")); + QCOMPARE(l1->sizeHint(), label->sizeHint()); +} + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc"