summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/gridview/gridview.qml
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-05 10:25:45 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-05 10:25:45 (GMT)
commitf30d3602011780e598e6b55c69d0b40a9cc94e16 (patch)
tree12449eb61dc1f119d9254198979ec51295fa9151 /doc/src/snippets/declarative/gridview/gridview.qml
parent349e9189e205c3dfdef271798310d1f38163b891 (diff)
parent1f221f04afb2fc8a1426d30f77f3e6026fdbdab7 (diff)
downloadQt-f30d3602011780e598e6b55c69d0b40a9cc94e16.zip
Qt-f30d3602011780e598e6b55c69d0b40a9cc94e16.tar.gz
Qt-f30d3602011780e598e6b55c69d0b40a9cc94e16.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml: (3324 commits) Fix test. Remove hacky fix (breaks autotest). Fix Behaviors for object-type properties. Pass symbols::prefix (Action -> QmlAction) Add license header. Fix bad merge (compile) Pass tst_headers::licenseCheck Fix ListView tests. Test fixes. More test fixes. Clean up QmlImageReader thread on engine destruction. Update test to handle QmlNetworkAccessManagerFactory Test fixes. Add a QEXPECT_FAIL for known bug. Fix autotest. Add some painting benchmarks. Make sure cookies are saved. Fix headers::licenseCheck autotest failure Re-add accidentally deleted file Test SizeItemToLoader to SizeLoaderToItem resizeMode change. ...
Diffstat (limited to 'doc/src/snippets/declarative/gridview/gridview.qml')
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
new file mode 100644
index 0000000..1a2021c
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -0,0 +1,47 @@
+import Qt 4.6
+
+//! [3]
+Rectangle {
+ 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
+ Column {
+ 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
+ Rectangle {
+ 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]