Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7355

Problem with QFileSystemModel in combination with setFilter() and QTreeView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.6.0
    • Widgets: Itemviews
    • None

      Platform: Windows XP

      Reproduce:

      1.) Create a QFileSystemModel:

      QFileSystemModel *fileSystemModel = new QFileSystemModel;
      fileSystemModel->setRootPath(QDir::currentPath());

      2.) Set a filter to this model to display only directories:

      fileSystemModel->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);

      3.) Create a QTreeView to render the model:

      QTreeView *fileTree = new QTreeView;
      fileTree->setModel(fileSystemModel);

      4.) Hide the header and set columns 1-3 invisible. So you get a directory tree structure.

      Problem: Some tree nodes without children (i. e. directories without including subdirectories) are rendered as expandable, i. e. a "+" is rendered left to them. If you click the node, it is rendered as collapsable. If you expand another node, the tree probably is updated and the node is correctly rendered as a leave.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            menard Alexis Menard (closed Nokia identity) (Inactive)
            luping B. Krevert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes