diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-01-26 11:46:56 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-01-26 11:46:56 +0100 |
commit | 9225ac7348c9023093b6ef8d4519087c7dddeaa2 (patch) | |
tree | 4660e25bd5cfd4a2a40b0ad97ea689c4acb22a8c /tests/auto/quick/qquickpathview | |
parent | 9d8fe2ac121162c15be6728495be2235b728325a (diff) | |
parent | 0076c44d3993f377ad6417d3bb08109b608dfbd2 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Change-Id: I7962fd2282792c43af69784c8e98fb050fd928a7
Diffstat (limited to 'tests/auto/quick/qquickpathview')
-rw-r--r-- | tests/auto/quick/qquickpathview/data/removePath.qml | 26 | ||||
-rw-r--r-- | tests/auto/quick/qquickpathview/tst_qquickpathview.cpp | 14 |
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickpathview/data/removePath.qml b/tests/auto/quick/qquickpathview/data/removePath.qml new file mode 100644 index 0000000000..85029f3eaf --- /dev/null +++ b/tests/auto/quick/qquickpathview/data/removePath.qml @@ -0,0 +1,26 @@ +import QtQuick 2.0 + +PathView { + width: 240 + height: 200 + + path: myPath + + delegate: Text { text: value } + model: 10 + + Path { + id: myPath + startX: 120; startY: 100 + PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 } + PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 } + } + + function removePath() { + path = null + } + + function setPath() { + path = myPath + } +} diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index ba3d182efc..b01d0c3cec 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -141,6 +141,7 @@ private slots: void addCustomAttribute(); void movementDirection_data(); void movementDirection(); + void removePath(); }; class TestObject : public QObject @@ -2504,6 +2505,19 @@ void tst_QQuickPathView::movementDirection() verify_offsets(pathview, toidx, fromoffset, tooffset); } +void tst_QQuickPathView::removePath() +{ + QScopedPointer<QQuickView> window(createView()); + window->setSource(testFileUrl("removePath.qml")); + window->show(); + + QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject()); + QVERIFY(pathview != 0); + + QVERIFY(QMetaObject::invokeMethod(pathview, "removePath")); + QVERIFY(QMetaObject::invokeMethod(pathview, "setPath")); +} + QTEST_MAIN(tst_QQuickPathView) #include "tst_qquickpathview.moc" |