summaryrefslogtreecommitdiffstats
path: root/util/qt3d/modeltweak/qml/Widgets/Checkered.qml
diff options
context:
space:
mode:
Diffstat (limited to 'util/qt3d/modeltweak/qml/Widgets/Checkered.qml')
-rw-r--r--util/qt3d/modeltweak/qml/Widgets/Checkered.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/util/qt3d/modeltweak/qml/Widgets/Checkered.qml b/util/qt3d/modeltweak/qml/Widgets/Checkered.qml
new file mode 100644
index 00000000..49bf1d82
--- /dev/null
+++ b/util/qt3d/modeltweak/qml/Widgets/Checkered.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Grid {
+ property variant color1: "#FFFFFF"
+ property variant color2: "#BBBBBB"
+ property variant cellSize: 10
+ width: 20
+ height: parent.height
+ clip: true
+
+ rows: height/cellSize
+ columns: width/cellSize
+ Repeater {
+ model: parent.rows * parent.columns
+ Rectangle {
+ width: cellSize; height: cellSize;
+ color: {
+ var check;
+ if (columns%2) check = index;
+ else check = Math.floor(index/columns)%2 + index;
+
+ if (check%2) return color1;
+ else return color2;
+ }
+ }
+ }
+}