aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/conversionDecrement.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/conversionDecrement.qml')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/conversionDecrement.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/conversionDecrement.qml b/tests/auto/qml/qmlcppcodegen/data/conversionDecrement.qml
new file mode 100644
index 0000000000..fdce0fe65c
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/conversionDecrement.qml
@@ -0,0 +1,18 @@
+pragma Strict
+import QtQml
+
+QtObject {
+ id: panelGrid
+ property var pages: 4
+ property int currentPageIndex: 0
+
+ onPagesChanged: {
+ if (panelGrid.currentPageIndex === 0) {
+ panelGrid.currentPageIndex = panelGrid.pages - 2
+ } else if (panelGrid.currentPageIndex === panelGrid.pages - 1) {
+ panelGrid.currentPageIndex = 0
+ } else {
+ panelGrid.currentPageIndex -= 1
+ }
+ }
+}