aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktumbler_p.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-02-13 16:18:26 +0100
committerMitch Curtis <mitch.curtis@qt.io>2018-02-16 15:17:30 +0000
commitf6eb6a3661f5c8c47c539d38b5bcb0a33c22d904 (patch)
tree72dbe00758ea1565f554834d6a71d86984891e85 /src/quicktemplates2/qquicktumbler_p.h
parentacfe7fc8bb19c591a4c44d88aac95b3caa3d445f (diff)
Tumbler: add positionViewAtIndex() function
This calls the respective PathView/ListView function (depending on the value of wrap), and allows users to change the current index without animations. [ChangeLog][Controls][Tumbler] Added positionViewAtIndex() function that calls the respective PathView/ListView function, depending on the value of wrap. This allows changing currentIndex without animations. Task-number: QTBUG-66358 Change-Id: I7fe73bd3e53548ef41a165b68637d99f3171e02e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktumbler_p.h')
-rw-r--r--src/quicktemplates2/qquicktumbler_p.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquicktumbler_p.h b/src/quicktemplates2/qquicktumbler_p.h
index 5d4df4a7..3f7c06db 100644
--- a/src/quicktemplates2/qquicktumbler_p.h
+++ b/src/quicktemplates2/qquicktumbler_p.h
@@ -100,6 +100,19 @@ public:
// 2.2 (Qt 5.9)
bool isMoving() const;
+ enum PositionMode {
+ Beginning,
+ Center,
+ End,
+ Visible, // ListView-only
+ Contain,
+ SnapPosition
+ };
+ Q_ENUM(PositionMode)
+
+ // 2.5 (Qt 5.12)
+ Q_REVISION(5) Q_INVOKABLE void positionViewAtIndex(int index, PositionMode mode);
+
Q_SIGNALS:
void modelChanged();
void countChanged();