diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-17 14:27:48 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-17 14:27:48 (GMT) |
commit | 62e641691b9a3eadc8b9fb2e31150cdf5b66115d (patch) | |
tree | 9033ae42f5b599e564421db69737ca0c70a85f53 /tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | |
parent | e76c4c03c98091ee3e509a0f9b64daba472567ff (diff) | |
parent | e02859c3c7910ab3de0ec594fd493df946a5102d (diff) | |
download | Qt-62e641691b9a3eadc8b9fb2e31150cdf5b66115d.zip Qt-62e641691b9a3eadc8b9fb2e31150cdf5b66115d.tar.gz Qt-62e641691b9a3eadc8b9fb2e31150cdf5b66115d.tar.bz2 |
Merge remote branch 'mainline/4.6' into 4.6
Diffstat (limited to 'tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp')
-rw-r--r-- | tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 6b5ad09..829e55c 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -160,6 +160,7 @@ private slots: void widgetSendsGeometryChanges(); void respectHFW(); void addChildInpolishEvent(); + void polishEvent(); // Task fixes void task236127_bspTreeIndexFails(); @@ -2768,6 +2769,32 @@ void tst_QGraphicsWidget::addChildInpolishEvent() QCOMPARE(PolishWidget::numberOfPolish, 2); } +void tst_QGraphicsWidget::polishEvent() +{ + class MyGraphicsWidget : public QGraphicsWidget + { public: + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) + { events << QEvent::Paint; } + void polishEvent() + { events << QEvent::Polish; } + QList<QEvent::Type> events; + }; + + QGraphicsScene scene; + + MyGraphicsWidget *widget = new MyGraphicsWidget; + scene.addItem(widget); + + QGraphicsView view(&scene); + view.show(); + QTest::qWaitForWindowShown(&view); + + // Make sure the item is painted. + QTRY_VERIFY(widget->events.contains(QEvent::Paint)); + + // Make sure the item got polish before paint. + QCOMPARE(widget->events.at(0), QEvent::Polish); +} QTEST_MAIN(tst_QGraphicsWidget) #include "tst_qgraphicswidget.moc" |