+ delete window;
+}
+
+void tst_QQuickPathView::offset_data()
+{
+ QTest::addColumn<qreal>("offset");
+ QTest::addColumn<int>("currentIndex");
+
+ QTest::newRow("0.0") << 0.0 << 0;
+ QTest::newRow("1.0") << 7.0 << 1;
+ QTest::newRow("5.0") << 5.0 << 3;
+ QTest::newRow("4.6") << 4.6 << 3;
+ QTest::newRow("4.4") << 4.4 << 4;
+ QTest::newRow("5.4") << 5.4 << 3;
+ QTest::newRow("5.6") << 5.6 << 2;
+}
+
+void tst_QQuickPathView::offset()
+{
+ QFETCH(qreal, offset);
+ QFETCH(int, currentIndex);
+
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("pathview3.qml"));
+ QQuickPathView *view = qobject_cast<QQuickPathView*>(c.create());
+
+ view->setOffset(offset);
+ QCOMPARE(view->currentIndex(), currentIndex);
+
+ delete view;