diff options
| author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-07-21 17:07:14 +0200 |
|---|---|---|
| committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-07-27 10:39:44 +0000 |
| commit | 09d9ce27ab9ac29aaa36c6d54fe89064dfcde69f (patch) | |
| tree | fb03cccd2afc67155362d7d6980a89b4633efff2 /examples/quick/controls/filesystembrowser/main.cpp | |
| parent | dd9f2665b1f84f0ba8ed21f5c47b532b2dc4db87 (diff) | |
TreeView: Add rootIndex property
Its purpose is the same as QAbstractItemView::rootIndex
and allows to display only the part of the model data that
is descendant of this index.
The filesystembrowser example has been updated to only show
files reachable from the user's home directory.
[ChangeLog][TreeView] Added rootIndex property
Change-Id: Ib8d9af4ce9d1f341ab509de3cc991773830ba9f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'examples/quick/controls/filesystembrowser/main.cpp')
| -rw-r--r-- | examples/quick/controls/filesystembrowser/main.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/quick/controls/filesystembrowser/main.cpp b/examples/quick/controls/filesystembrowser/main.cpp index 176d334c4..1322bc497 100644 --- a/examples/quick/controls/filesystembrowser/main.cpp +++ b/examples/quick/controls/filesystembrowser/main.cpp @@ -137,6 +137,7 @@ int main(int argc, char *argv[]) fsm->setRootPath(QDir::homePath()); fsm->setResolveSymlinks(true); engine.rootContext()->setContextProperty("fileSystemModel", fsm); + engine.rootContext()->setContextProperty("rootPathIndex", fsm->index(fsm->rootPath())); engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); return app.exec(); |
