diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-08-17 13:41:51 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-08-17 14:03:18 (GMT) |
commit | 85edfcbde9f1d2f77a05edb8d01361c76234f47c (patch) | |
tree | 2ea157a78561ca64fdc6a1edc226b12b610aa6d1 /tests/auto/qgraphicsitem | |
parent | 53807e58770f27d46ca8ecaa33a3d5f7b6925517 (diff) | |
download | Qt-85edfcbde9f1d2f77a05edb8d01361c76234f47c.zip Qt-85edfcbde9f1d2f77a05edb8d01361c76234f47c.tar.gz Qt-85edfcbde9f1d2f77a05edb8d01361c76234f47c.tar.bz2 |
Merge QGV delta from kinetic-declarativeui into master.
New flag: QGraphicsItem::ItemNegativeZStacksBehindParent, which makes
it easy to toggle stack-behind based on the value of Z alone.
Add interface initializations to QGV classes.
Add a simple internal focus policy to QGraphicsItem to allow derived
items to be focusable without allowing clickfocus.
Reviewed-by: Alexis
Diffstat (limited to 'tests/auto/qgraphicsitem')
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index a623b50..10f0e42 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -281,6 +281,7 @@ private slots: void subFocus(); void reverseCreateAutoFocusProxy(); void focusProxyDeletion(); + void negativeZStacksBehindParent(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -7558,5 +7559,30 @@ void tst_QGraphicsItem::focusProxyDeletion() delete scene; // don't crash } +void tst_QGraphicsItem::negativeZStacksBehindParent() +{ + QGraphicsRectItem rect; + QCOMPARE(rect.zValue(), qreal(0.0)); + QVERIFY(!(rect.flags() & QGraphicsItem::ItemNegativeZStacksBehindParent)); + QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent)); + rect.setZValue(-1); + QCOMPARE(rect.zValue(), qreal(-1.0)); + QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent)); + rect.setZValue(0); + rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent); + QVERIFY(rect.flags() & QGraphicsItem::ItemNegativeZStacksBehindParent); + QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent)); + rect.setZValue(-1); + QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent); + rect.setZValue(0); + QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent)); + rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, false); + rect.setZValue(-1); + rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, true); + QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent); + rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, false); + QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" |