Dir View Example

This example demonstrates the usage of a tree view

This example demonstrates the usage of a tree view.

The Dir View example shows a tree view of the local file system. It uses the QFileSystemModel class to provide file and directory information.

The example supports a number of command line options. These options include:

  • Application description

  • -help option

  • -version option

  • if the optionc {-c} is specified, the application will not use custom directory options

Declares model as data model for reading the local filesystem. model.setRootPath("") sets the current folder as the folder from which model will start reading. QTreeView object tree visualizes the filesystem in a tree structure.

Sets layout options for animation, indentation, sorting, and sizing of the filesystem tree.

main.cpp Example File

dirview.pro Example File