diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-07-29 10:41:47 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-29 04:08:13 +0200 |
commit | d08fb44d8f1414bbf519875fd872d742c41300ec (patch) | |
tree | a5b3009e1e8193a0badb7c8f2f28b737940b44b7 /tests/auto/declarative/qsgpathview | |
parent | 44f82f2078897270622581e1c3f385d12c3aba42 (diff) |
Correctly set ending path percent if none is provided.
Task-number: QTBUG-19818
Change-Id: I5377551d041b593864d56e4449c133deb47d3b45
Reviewed-on: http://codereview.qt.nokia.com/2358
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qsgpathview')
-rw-r--r-- | tests/auto/declarative/qsgpathview/data/missingPercent.qml | 9 | ||||
-rw-r--r-- | tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgpathview/data/missingPercent.qml b/tests/auto/declarative/qsgpathview/data/missingPercent.qml new file mode 100644 index 0000000000..97af8e8982 --- /dev/null +++ b/tests/auto/declarative/qsgpathview/data/missingPercent.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 + +Path { + startY: 0 + startX: 0 + PathLine { x: 0; y: 50 } + PathPercent { value: .5 } + PathLine { x: 50; y: 50 } +} diff --git a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp index bc0448d767..91f6491493 100644 --- a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp +++ b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp @@ -115,6 +115,7 @@ private slots: void mouseDrag(); void treeModel(); void changePreferredHighlight(); + void missingPercent(); private: QSGView *createView(); @@ -1072,6 +1073,17 @@ QList<T*> tst_QSGPathView::findItems(QSGItem *parent, const QString &objectName) return items; } +void tst_QSGPathView::missingPercent() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/missingPercent.qml")); + QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create()); + QVERIFY(obj); + QCOMPARE(obj->attributeAt("_qfx_percent", 1.0), qreal(1.0)); + delete obj; +} + + QTEST_MAIN(tst_QSGPathView) #include "tst_qsgpathview.moc" |