diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 63a3f92..e8a6d10 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -229,6 +229,7 @@ private slots: void moveItem(); void sorting_data(); void sorting(); + void itemHasNoContents(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -7031,5 +7032,31 @@ void tst_QGraphicsItem::sorting() << item1 << item2); } +void tst_QGraphicsItem::itemHasNoContents() +{ + PainterItem *item1 = new PainterItem; + PainterItem *item2 = new PainterItem; + item2->setParentItem(item1); + item2->setPos(50, 50); + item1->setFlag(QGraphicsItem::ItemHasNoContents); + item1->setFlag(QGraphicsItem::ItemClipsChildrenToShape); + + QGraphicsScene scene; + scene.addItem(item1); + + QGraphicsView view(&scene); + view.show(); +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&view); +#endif + QTest::qWait(100); + + _paintedItems.clear(); + + view.viewport()->repaint(); + + QCOMPARE(_paintedItems, QList<QGraphicsItem *>() << item2); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" |