Skip to content

Commit

Permalink
Doc: complete Dir View Example
Browse files Browse the repository at this point in the history
- add updated screenshot
- add basic doc to example code

Change-Id: Iad616b285ee1470571adc38b868fcf8a0ed64840
Reviewed-by: Topi Reiniö <[email protected]>
  • Loading branch information
vertrni committed Mar 13, 2018
1 parent e9dc2f1 commit 0daa14e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
Binary file modified doc/src/images/dirview-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 33 additions & 3 deletions examples/widgets/doc/src/dirview.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

0 comments on commit 0daa14e

Please sign in to comment.