summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/pathview
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-01 00:06:55 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-01 00:06:55 (GMT)
commit3e3e22b2eb1ac2cc3fa33de3810962cd95be9988 (patch)
treeb45318b9328ec5c6d47885593746576016af1793 /doc/src/snippets/declarative/pathview
parent5b548025ca353fa2f512356d0969b096b5b705e1 (diff)
downloadQt-3e3e22b2eb1ac2cc3fa33de3810962cd95be9988.zip
Qt-3e3e22b2eb1ac2cc3fa33de3810962cd95be9988.tar.gz
Qt-3e3e22b2eb1ac2cc3fa33de3810962cd95be9988.tar.bz2
PathView format conversion.
Diffstat (limited to 'doc/src/snippets/declarative/pathview')
-rw-r--r--doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml15
-rw-r--r--doc/src/snippets/declarative/pathview/pathattributes.qml34
-rw-r--r--doc/src/snippets/declarative/pathview/pathview.qml28
-rw-r--r--doc/src/snippets/declarative/pathview/pics/qtlogo-64.pngbin0 -> 2991 bytes
4 files changed, 77 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml b/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml
new file mode 100644
index 0000000..5b973d7
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml
@@ -0,0 +1,15 @@
+ListModel2 {
+ id: MenuModel
+ ListElement {
+ name: "Bill Jones"
+ icon: "pics/qtlogo-64.png"
+ }
+ ListElement {
+ name: "Jane Doe"
+ icon: "pics/qtlogo-64.png"
+ }
+ ListElement {
+ name: "John Smith"
+ icon: "pics/qtlogo-64.png"
+ }
+}
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
new file mode 100644
index 0000000..44789f2
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -0,0 +1,34 @@
+Rect {
+ width: 240; height: 200; color: 'white'
+//! [0]
+//! [1]
+ Component {
+ id: Delegate
+ Item {
+ id: Wrapper
+ width: 80; height: 80
+ scale: PathView.scale
+ opacity: PathView.opacity
+ VerticalLayout {
+ Image { anchors.horizontalCenter: Name.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { id: Name; text: name; font.size: 16}
+ }
+ }
+ }
+//! [1]
+//! [2]
+ PathView {
+ anchors.fill: parent; model: MenuModel; delegate: Delegate
+ path: Path {
+ startX: 120; startY: 100
+ PathAttribute { name: "scale"; value: 1.0 }
+ PathAttribute { name: "opacity"; value: 1.0 }
+ PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
+ PathAttribute { name: "scale"; value: 0.3 }
+ PathAttribute { name: "opacity"; value: 0.5 }
+ PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
+ }
+ }
+//! [2]
+//! [0]
+}
diff --git a/doc/src/snippets/declarative/pathview/pathview.qml b/doc/src/snippets/declarative/pathview/pathview.qml
new file mode 100644
index 0000000..11df0a2
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/pathview.qml
@@ -0,0 +1,28 @@
+Rect {
+ width: 240; height: 200; color: 'white'
+//! [0]
+//! [1]
+ Component {
+ id: Delegate
+ Item {
+ id: Wrapper
+ width: 80; height: 80
+ VerticalLayout {
+ Image { anchors.horizontalCenter: Name.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { id: Name; text: name; font.size: 16}
+ }
+ }
+ }
+//! [1]
+//! [2]
+ PathView {
+ anchors.fill: parent; model: MenuModel; delegate: Delegate
+ path: Path {
+ startX: 120; startY: 100
+ PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
+ PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
+ }
+ }
+//! [2]
+//! [0]
+}
diff --git a/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png b/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png
new file mode 100644
index 0000000..4f68e16
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png
Binary files differ