summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-08-17 15:41:51 +0200
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-08-17 16:03:18 +0200
commit85edfcbde9f1d2f77a05edb8d01361c76234f47c (patch)
tree2ea157a78561ca64fdc6a1edc226b12b610aa6d1 /tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
parent53807e58770f27d46ca8ecaa33a3d5f7b6925517 (diff)
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/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index a623b50667..10f0e42ea0 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"