summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-06 01:45:03 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-06 01:45:03 (GMT)
commit908027ae023f089bf83a2b614e933927989b524c (patch)
tree09f5227a2e2bbab5ce313a54b17846b190af235c /doc
parente320db210c41c1a45a88aad4c592024f433e6ad0 (diff)
parent5edf4ed878bbe933e6ff0023cce8808b1dcff6c0 (diff)
downloadQt-908027ae023f089bf83a2b614e933927989b524c.zip
Qt-908027ae023f089bf83a2b614e933927989b524c.tar.gz
Qt-908027ae023f089bf83a2b614e933927989b524c.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'doc')
-rw-r--r--doc/src/declarative/elements.qdoc5
-rw-r--r--doc/src/declarative/pics/content.pngbin0 -> 1978 bytes
-rw-r--r--doc/src/declarative/pics/gridview.pngbin1369 -> 10564 bytes
-rw-r--r--doc/src/snippets/declarative/GroupBox.qml18
-rw-r--r--doc/src/snippets/declarative/content.qml7
-rw-r--r--doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml23
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml45
-rw-r--r--doc/src/snippets/declarative/gridview/pics/portrait.pngbin0 -> 3126 bytes
-rw-r--r--doc/src/snippets/declarative/listview/dummydata/ContactModel.qml33
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml5
10 files changed, 103 insertions, 33 deletions
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index b6dec25..ae1428a 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -97,7 +97,10 @@ The following table lists the Qml elements provided by the Qt Declarative module
\o
\list
\o \l Repeater
-\o \l Content
+\o \l ContentWrapper
+ \list
+ \o \l Content
+ \endlist
\o \l ComponentInstance
\o \l WidgetContainer
\endlist
diff --git a/doc/src/declarative/pics/content.png b/doc/src/declarative/pics/content.png
new file mode 100644
index 0000000..47a98ac
--- /dev/null
+++ b/doc/src/declarative/pics/content.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview.png b/doc/src/declarative/pics/gridview.png
index d5c8b4b..3726893 100644
--- a/doc/src/declarative/pics/gridview.png
+++ b/doc/src/declarative/pics/gridview.png
Binary files differ
diff --git a/doc/src/snippets/declarative/GroupBox.qml b/doc/src/snippets/declarative/GroupBox.qml
index a8ff5be..fd8d60b 100644
--- a/doc/src/snippets/declarative/GroupBox.qml
+++ b/doc/src/snippets/declarative/GroupBox.qml
@@ -1,11 +1,13 @@
ContentWrapper {
- id: Container; width: parent.width
- Rect {
- width: parent.width; color: "white"; pen.width: 2; pen.color: "#adaeb0"; radius: 10
- clip: false; height: contents.height
- VerticalLayout {
- id: layout; width: parent.width
- Content {}
+ id: Container; width: parent.width; height: contents.height
+ children: [
+ Rect {
+ width: parent.width; height: contents.height
+ color: "white"; pen.width: 2; pen.color: "#adaeb0"; radius: 10
+ VerticalLayout {
+ id: layout; width: parent.width; margin: 5; spacing: 2
+ Content { }
+ }
}
- }
+ ]
}
diff --git a/doc/src/snippets/declarative/content.qml b/doc/src/snippets/declarative/content.qml
index be04c6e..6f9e0d8 100644
--- a/doc/src/snippets/declarative/content.qml
+++ b/doc/src/snippets/declarative/content.qml
@@ -1,6 +1,7 @@
-GroupBox {
- content: [
+Rect {
+ width: 200; height: 100; color: "lightgray"
+ GroupBox {
Text { text: "First Item" }
Text { text: "Second Item" }
- ]
+ }
}
diff --git a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
new file mode 100644
index 0000000..accbc3e
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
@@ -0,0 +1,23 @@
+ListModel {
+ id: ContactModel
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "Jim Williams"
+ number: "555 5673"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ portrait: "pics/portrait.png"
+ }
+}
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
new file mode 100644
index 0000000..0fca789
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -0,0 +1,45 @@
+//! [3]
+Rect {
+ width: 240; height: 180; color: "white"
+ // ContactModel model is defined in dummydata/ContactModel.qml
+ // The viewer automatically loads files in dummydata/* to assist
+ // development without a real data source.
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+//! [0]
+ Component {
+ id: Delegate
+ Item {
+ id: Wrapper
+ width: 80; height: 78
+ VerticalLayout {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+ }
+ }
+//! [0]
+ // Define a highlight component. Just one of these will be instantiated
+ // by each ListView and placed behind the current item.
+//! [1]
+ Component {
+ id: Highlight
+ Rect {
+ color: "lightsteelblue"
+ radius: 5
+ }
+ }
+//! [1]
+ // The actual grid
+//! [2]
+ GridView {
+ width: parent.width; height: parent.height
+ model: ContactModel; delegate: Delegate
+ cellWidth: 80; cellHeight: 80
+ highlight: Highlight
+ focus: true
+ }
+//! [2]
+}
+//! [3]
diff --git a/doc/src/snippets/declarative/gridview/pics/portrait.png b/doc/src/snippets/declarative/gridview/pics/portrait.png
new file mode 100644
index 0000000..fb5052a
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/pics/portrait.png
Binary files differ
diff --git a/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml
index 302dfd2..53c745e 100644
--- a/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml
+++ b/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml
@@ -1,18 +1,15 @@
-<!--
-ListModel allows free form list models to be defined and populated.
-Be sure to name the file the same as the id.
--->
-<ListModel id="ContactModel">
- <Contact>
- <name>Bill Smith</name>
- <number>555 3264</number>
- </Contact>
- <Contact>
- <name>John Brown</name>
- <number>555 8426</number>
- </Contact>
- <Contact>
- <name>Sam Wise</name>
- <number>555 0473</number>
- </Contact>
-</ListModel>
+ListModel {
+ id: ContactModel
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+}
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
index 5b99bbd..3596af1 100644
--- a/doc/src/snippets/declarative/listview/listview.qml
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -1,7 +1,7 @@
//! [3]
Rect {
- width: 480
- height: 40
+ width: 180
+ height: 200
color: "white"
// ContactModel model is defined in dummydata/ContactModel.qml
// The viewer automatically loads files in dummydata/* to assist
@@ -48,7 +48,6 @@ Rect {
delegate: Delegate
highlight: Highlight
focus: true
- orientation: 'Horizontal'
}
//! [2]
}