summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-14 07:59:52 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-14 07:59:52 (GMT)
commitb70dd15c635990306bab35e440d7b561cac7c67e (patch)
treeb77966b6e81063257cff343bc61ba9c0dc4cb9b3 /examples
parentb915d0aa46599f707df4db6eb33965602a2d7422 (diff)
parentd9ab23c190de774ea093652060981e14ac5aeaf8 (diff)
downloadQt-b70dd15c635990306bab35e440d7b561cac7c67e.zip
Qt-b70dd15c635990306bab35e440d7b561cac7c67e.tar.gz
Qt-b70dd15c635990306bab35e440d7b561cac7c67e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Qt.include() support in worker scripts Only add "include" property in non-workerscript threads Missing files from 645b9ee9dd6e0576542cc61872ecedb408ca8a89 Reduce the chance of AnchorAnimation animating geometry changes it Add Qt.include() method for scoped inclusion of JavaScript files Fix crash in ParentAnimation. Revert "Fix crash in ParentAnimation." Symbian build fix to declarative auto and benchmark tests Revert "Use raster graphicssystem for qml.app on OS X." Fix crash in ParentAnimation. Minor declarative webview tweaks Removed dependency of QDeclarativeWebView to private Qt (Declarative) API Note that you need to unset a flag to create a visual item Follow-up on Flickable changes. ListModel::get() should return undefined if bad index specified Add an example spinner. Fix crash on remote content. Dates and variants are not considered nested objects
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/declarative.pro1
-rw-r--r--examples/declarative/spinner/content/Spinner.qml25
-rw-r--r--examples/declarative/spinner/content/spinner-bg.pngbin0 -> 345 bytes
-rw-r--r--examples/declarative/spinner/content/spinner-select.pngbin0 -> 320 bytes
-rw-r--r--examples/declarative/spinner/main.qml18
-rw-r--r--examples/declarative/spinner/spinner.qmlproject16
6 files changed, 60 insertions, 0 deletions
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
index ba9b628..913b2b0 100644
--- a/examples/declarative/declarative.pro
+++ b/examples/declarative/declarative.pro
@@ -37,6 +37,7 @@ sources.files = \
scrollbar \
searchbox \
slideswitch \
+ spinner \
sql \
states \
tabwidget \
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
new file mode 100644
index 0000000..b3556f1
--- /dev/null
+++ b/examples/declarative/spinner/content/spinner-bg.png
Binary files differ
diff --git a/examples/declarative/spinner/content/spinner-select.png b/examples/declarative/spinner/content/spinner-select.png
new file mode 100644
index 0000000..95a17a1
--- /dev/null
+++ b/examples/declarative/spinner/content/spinner-select.png
Binary files differ
diff --git a/examples/declarative/spinner/main.qml b/examples/declarative/spinner/main.qml
new file mode 100644
index 0000000..6be567a
--- /dev/null
+++ b/examples/declarative/spinner/main.qml
@@ -0,0 +1,18 @@
+import Qt 4.7
+import "content"
+
+Rectangle {
+ width: 240; height: 320
+ Column {
+ y: 20; x: 20; spacing: 20
+ Spinner {
+ id: spinner
+ width: 200; height: 240
+ focus: true
+ model: 20
+ itemHeight: 30
+ delegate: Text { font.pixelSize: 25; text: index; height: 30 }
+ }
+ Text { text: "Current item index: " + spinner.currentIndex }
+ }
+}
diff --git a/examples/declarative/spinner/spinner.qmlproject b/examples/declarative/spinner/spinner.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/spinner/spinner.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}