summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-02-01 06:10:01 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-02-02 02:59:48 (GMT)
commit0ee4b2f32a539ee5dc1c08a838f6584ca9d896d4 (patch)
treee6d39a57287245aeaf21a255d27380e2e8103ada /doc
parent08a3db6efd9fa48701491f9e8a8070e825a132f5 (diff)
downloadQt-0ee4b2f32a539ee5dc1c08a838f6584ca9d896d4.zip
Qt-0ee4b2f32a539ee5dc1c08a838f6584ca9d896d4.tar.gz
Qt-0ee4b2f32a539ee5dc1c08a838f6584ca9d896d4.tar.bz2
Add initial size to ListView in FolderListModel example
Plus other minor doc changes
Diffstat (limited to 'doc')
-rw-r--r--doc/src/examples/qml-folderlistmodel.qdoc7
-rw-r--r--doc/src/snippets/declarative/folderlistmodel.qml12
2 files changed, 14 insertions, 5 deletions
diff --git a/doc/src/examples/qml-folderlistmodel.qdoc b/doc/src/examples/qml-folderlistmodel.qdoc
index c9d248e..0a01ce0 100644
--- a/doc/src/examples/qml-folderlistmodel.qdoc
+++ b/doc/src/examples/qml-folderlistmodel.qdoc
@@ -41,10 +41,15 @@ making the model available to QML.
\section1 Usage from QML
-The type we are creating can be used from QML like this:
+The FolderListModel can be used from QML like this:
\snippet doc/src/snippets/declarative/folderlistmodel.qml 0
+This displays a list of all subfolders and QML files in the current folder.
+
+The FolderListModel \c folder property can be set to change the folder that
+is currently displayed.
+
\section1 Defining the Model
We are subclassing QAbstractListModel which will allow us to give data to QML and
diff --git a/doc/src/snippets/declarative/folderlistmodel.qml b/doc/src/snippets/declarative/folderlistmodel.qml
index 3bddefb..8aeb72c 100644
--- a/doc/src/snippets/declarative/folderlistmodel.qml
+++ b/doc/src/snippets/declarative/folderlistmodel.qml
@@ -43,15 +43,19 @@ import QtQuick 1.0
import Qt.labs.folderlistmodel 1.0
ListView {
+ width: 200; height: 400
+
FolderListModel {
- id: foldermodel
+ id: folderModel
nameFilters: ["*.qml"]
}
+
Component {
- id: filedelegate
+ id: fileDelegate
Text { text: fileName }
}
- model: foldermodel
- delegate: filedelegate
+
+ model: folderModel
+ delegate: fileDelegate
}
//![0]