aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickgridview/data
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-19 12:49:16 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-19 12:59:04 +0100
commit4e7f570f921671c627040537b4dd8cdb77bda3d1 (patch)
tree7d82e1b6536d5274ab29a3e6307fedcbefd3ce78 /tests/auto/quick/qquickgridview/data
parent72447b6dbf98ace65ec46559337243970a668d26 (diff)
parent39df6760e4db6af700c46a420286b51113b5dadb (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/quick/items/qquickitem.cpp tests/auto/quick/qquickgridview/tst_qquickgridview.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I3cf47faa2fe567d62fffd985aeecbefe5811cc42
Diffstat (limited to 'tests/auto/quick/qquickgridview/data')
-rw-r--r--tests/auto/quick/qquickgridview/data/qtbug48870.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickgridview/data/qtbug48870.qml b/tests/auto/quick/qquickgridview/data/qtbug48870.qml
new file mode 100644
index 0000000000..7c0783fbb5
--- /dev/null
+++ b/tests/auto/quick/qquickgridview/data/qtbug48870.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.6
+
+Rectangle {
+ width: 500
+ height: 500
+ color: "blue"
+
+ GridView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ model: testModel
+ cellWidth: 150
+ cellHeight: 150
+ readonly property int columns: Math.floor(width / cellWidth)
+
+ delegate: Rectangle {
+ width: GridView.view.cellWidth
+ height: GridView.view.cellHeight
+ color: (row & 1) != (col & 1) ? "green" : "red"
+ readonly property int row: index / view.columns
+ readonly property int col: index % view.columns
+
+ Text {
+ anchors.centerIn: parent
+ text: "Item " + index
+ }
+ }
+ }
+}