diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-11 09:31:44 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-11 09:31:44 +0100 |
commit | 738d6e6a8402ac11245ec738da75920b39ad6830 (patch) | |
tree | 8baab375983869c8403d85cbe784f7b303600990 /framework/qml/ModelIndexRetriever.qml | |
parent | d24d1d070c986e57a004cf58b15bf3123f065abf (diff) | |
download | kube-738d6e6a8402ac11245ec738da75920b39ad6830.tar.gz kube-738d6e6a8402ac11245ec738da75920b39ad6830.zip |
Next/Previous buttons
Diffstat (limited to 'framework/qml/ModelIndexRetriever.qml')
-rw-r--r-- | framework/qml/ModelIndexRetriever.qml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/framework/qml/ModelIndexRetriever.qml b/framework/qml/ModelIndexRetriever.qml index d01ceb71..080012aa 100644 --- a/framework/qml/ModelIndexRetriever.qml +++ b/framework/qml/ModelIndexRetriever.qml | |||
@@ -22,6 +22,19 @@ Repeater { | |||
22 | id: root | 22 | id: root |
23 | property var currentData | 23 | property var currentData |
24 | property int currentIndex: 0 | 24 | property int currentIndex: 0 |
25 | |||
26 | function increaseCurrentIndex() { | ||
27 | if (currentIndex < count - 1) { | ||
28 | currentIndex = currentIndex + 1 | ||
29 | } | ||
30 | } | ||
31 | |||
32 | function decreaseCurrentIndex() { | ||
33 | if (currentIndex > 0) { | ||
34 | currentIndex = currentIndex - 1 | ||
35 | } | ||
36 | } | ||
37 | |||
25 | onCurrentIndexChanged: { | 38 | onCurrentIndexChanged: { |
26 | currentData = itemAt(currentIndex).currentData | 39 | currentData = itemAt(currentIndex).currentData |
27 | } | 40 | } |