diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-03-21 13:18:05 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-04 06:00:40 +0200 |
commit | 912c25633ede945fb9b64e09ecd9309e7cc2ac3c (patch) | |
tree | 35ef57607d3e586828bffaaff2f3300ebe4aabf9 /tests/auto/quick/qquickpathview/data | |
parent | 2e35d1c47b3a4ddadfda16e3337d4d8ef91b4ce3 (diff) |
Support snapMode in PathView
PathView missed out on snapMode, which is especially useful for
its SnapOneItem mode.
Change-Id: I0e9b080ef72d9bc1e305445cd8dfde8e21e4e3da
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickpathview/data')
-rw-r--r-- | tests/auto/quick/qquickpathview/data/panels.qml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickpathview/data/panels.qml b/tests/auto/quick/qquickpathview/data/panels.qml new file mode 100644 index 0000000000..a111e45736 --- /dev/null +++ b/tests/auto/quick/qquickpathview/data/panels.qml @@ -0,0 +1,44 @@ +import QtQuick 2.0 + +Item { + id: root + property bool snapOne: false + property bool enforceRange: false + width: 320; height: 480 + + VisualItemModel { + id: itemModel + + Rectangle { + width: root.width + height: root.height + color: "blue" + } + Rectangle { + width: root.width + height: root.height + color: "yellow" + } + Rectangle { + width: root.width + height: root.height + color: "green" + } + } + + PathView { + id: view + objectName: "view" + anchors.fill: parent + model: itemModel + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + flickDeceleration: 30 + highlightRangeMode: enforceRange ? PathView.StrictlyEnforceRange : PathView.NoHighlightRange + snapMode: root.snapOne ? PathView.SnapOneItem : PathView.SnapToItem + path: Path { + startX: -root.width; startY: root.height/2 + PathLine { x: root.width*2; y: root.height/2 } + } + } +} |