Doc: complete Dir View Example

- add updated screenshot
- add basic doc to example code

Change-Id: Iad616b285ee1470571adc38b868fcf8a0ed64840
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit is contained in:
Nico Vertriest 2017-12-12 13:30:32 +01:00
parent e9dc2f1783
commit 0daa14e191
2 changed files with 33 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -31,8 +31,38 @@
\ingroup examples-itemviews
\brief This example demonstrates the usage of a tree view.
\brief The Dir View example shows a tree view onto the local filing system. It uses the
QFileSystemModel class to provide file and directory information.
The Dir View example shows a tree view of the local file
system. It uses the QFileSystemModel class to provide file
and directory information.
\image dirview-example.png
\borderedimage dirview-example.png
The example supports a number of command line options.
These options include:
\list
\li Application description
\li -help option
\li -version option
\li if the optionc {-c} is specified, the application will not
use custom directory options
\endlist
\quotefromfile itemviews/dirview/main.cpp
\skipto QCommandLineParser parser
\printuntil parser.positionalArguments
Declares a QFileSystemModel as data model for viewing
the local file system. QFileSystem works with a cache, that is,
it is updated continually with QFileSystemWatcher on that folder.
\skipto QFileSystemModel
\printuntil tree.setModel
Creates a model/view implementation called \c tree
for viewing the filesystem.
\skipto tree.setAnimated(false)
\printuntil tree.setWindowTitle
Sets some formatting options for \c tree.
*/