diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-16 16:26:06 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-16 16:26:06 (GMT) |
commit | af1fa7fe766980210d7363c1559197f34b10d834 (patch) | |
tree | e2964649ca8469269950a265060b3d1e7e6026f6 /tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | |
parent | c5bfbe27f5bbdb1f3e76af8ca5e0f4df27875a06 (diff) | |
parent | 1433a2c8682cb1c8f89ceaf97ad7a509ac686879 (diff) | |
download | Qt-af1fa7fe766980210d7363c1559197f34b10d834.zip Qt-af1fa7fe766980210d7363c1559197f34b10d834.tar.gz Qt-af1fa7fe766980210d7363c1559197f34b10d834.tar.bz2 |
Merge branch '4.6'
Conflicts:
translations/assistant_adp_pl.ts
translations/assistant_adp_ru.ts
Diffstat (limited to 'tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp')
-rw-r--r-- | tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index f5e9acb..0589994 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -266,6 +266,7 @@ private slots: void dispatchHoverOnPress(); void initialFocus_data(); void initialFocus(); + void polishItems(); // task specific tests below me void task139710_bspTreeCrash(); @@ -3882,5 +3883,32 @@ void tst_QGraphicsScene::initialFocus() QCOMPARE(rect->hasFocus(), shouldHaveFocus); } +class PolishItem : public QGraphicsTextItem +{ +public: + PolishItem(QGraphicsItem *parent = 0) : QGraphicsTextItem(parent) { } + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant& value) + { + if (change == ItemVisibleChange) { + if (value.toBool()) + qDeleteAll(childItems()); + } + return QGraphicsItem::itemChange(change, value); + } +}; + +void tst_QGraphicsScene::polishItems() +{ + QGraphicsScene scene; + PolishItem *parent = new PolishItem; + scene.addItem(parent); + PolishItem *child = new PolishItem(parent); + Q_UNUSED(child) + // test that QGraphicsScenePrivate::_q_polishItems() doesn't crash + QMetaObject::invokeMethod(&scene,"_q_polishItems"); +} + QTEST_MAIN(tst_QGraphicsScene) #include "tst_qgraphicsscene.moc" |