aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml')
-rw-r--r--tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml
new file mode 100644
index 0000000000..2bfe7da78e
--- /dev/null
+++ b/tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml
@@ -0,0 +1,58 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ objectName: "wrapper"
+ height: 100
+ width: 100
+ Text {
+ text: index
+ }
+ Text {
+ y: 25
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ y: 50
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ y: 75
+ text: wrapper.y
+ }
+ }
+ }
+
+ Component {
+ id: myHighlight
+ Rectangle {
+ color: "lightsteelblue"
+ }
+ }
+
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ highlight: myHighlight
+ flow: (testTopToBottom == true) ? GridView.TopToBottom : GridView.LeftToRight
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
+ preferredHighlightBegin: 100
+ preferredHighlightEnd: 100
+ highlightRangeMode: "StrictlyEnforceRange"
+ focus: true
+ }
+}