summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-12-09 05:12:17 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-12-09 05:12:17 (GMT)
commit651b71feff5c703b2070e17b794e4744ec55f984 (patch)
treef70f8958f8cde5b7f34a33a888d94eb2d47e2514 /tests/auto/declarative
parent611bd1247ff8254c567dc2c50573e84093dd8c5a (diff)
parent4bad9d6661f6b63c6ce9b9a29e9f5cf7aa032e37 (diff)
downloadQt-651b71feff5c703b2070e17b794e4744ec55f984.zip
Qt-651b71feff5c703b2070e17b794e4744ec55f984.tar.gz
Qt-651b71feff5c703b2070e17b794e4744ec55f984.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/anchors/data/centerin.qml12
-rw-r--r--tests/auto/declarative/anchors/tst_anchors.cpp16
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/anchors/data/centerin.qml b/tests/auto/declarative/anchors/data/centerin.qml
new file mode 100644
index 0000000..09b97f6
--- /dev/null
+++ b/tests/auto/declarative/anchors/data/centerin.qml
@@ -0,0 +1,12 @@
+import Qt 4.6
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ objectName: "centered"
+ width: 50; height: 50; color: "blue"
+ anchors.centerIn: parent;
+ anchors.verticalCenterOffset: 30
+ anchors.horizontalCenterOffset: 10
+ }
+}
diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp
index 7378d95..bbe5ef1 100644
--- a/tests/auto/declarative/anchors/tst_anchors.cpp
+++ b/tests/auto/declarative/anchors/tst_anchors.cpp
@@ -71,6 +71,7 @@ private slots:
void nullItem();
void nullItem_data();
void crash1();
+ void centerIn();
};
/*
@@ -378,6 +379,21 @@ void tst_anchors::crash1()
delete view;
}
+void tst_anchors::centerIn()
+{
+ QmlView *view = new QmlView;
+
+ view->setUrl(QUrl("file://" SRCDIR "/data/centerin.qml"));
+
+ view->execute();
+ qApp->processEvents();
+
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("centered"))->x(), 85.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("centered"))->y(), 105.0);
+
+ delete view;
+}
+
QTEST_MAIN(tst_anchors)
#include "tst_anchors.moc"