diff options
Diffstat (limited to 'examples/declarative/spinner/content')
-rw-r--r-- | examples/declarative/spinner/content/Spinner.qml | 25 | ||||
-rw-r--r-- | examples/declarative/spinner/content/spinner-bg.png | bin | 0 -> 345 bytes | |||
-rw-r--r-- | examples/declarative/spinner/content/spinner-select.png | bin | 0 -> 320 bytes |
3 files changed, 25 insertions, 0 deletions
diff --git a/examples/declarative/spinner/content/Spinner.qml b/examples/declarative/spinner/content/Spinner.qml new file mode 100644 index 0000000..8145a28 --- /dev/null +++ b/examples/declarative/spinner/content/Spinner.qml @@ -0,0 +1,25 @@ +import Qt 4.7 + +Image { + property alias model: view.model + property alias delegate: view.delegate + property alias currentIndex: view.currentIndex + property real itemHeight: 30 + source: "spinner-bg.png" + clip: true + PathView { + id: view + anchors.fill: parent + pathItemCount: height/itemHeight + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + highlight: Image { source: "spinner-select.png"; width: view.width; height: itemHeight+4 } + dragMargin: view.width/2 + path: Path { + startX: view.width/2; startY: -itemHeight/2 + PathLine { x: view.width/2; y: view.pathItemCount*itemHeight + itemHeight } + } + } + Keys.onDownPressed: view.incrementCurrentIndex() + Keys.onUpPressed: view.decrementCurrentIndex() +} diff --git a/examples/declarative/spinner/content/spinner-bg.png b/examples/declarative/spinner/content/spinner-bg.png Binary files differnew file mode 100644 index 0000000..b3556f1 --- /dev/null +++ b/examples/declarative/spinner/content/spinner-bg.png diff --git a/examples/declarative/spinner/content/spinner-select.png b/examples/declarative/spinner/content/spinner-select.png Binary files differnew file mode 100644 index 0000000..95a17a1 --- /dev/null +++ b/examples/declarative/spinner/content/spinner-select.png |