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

Problem with QFileSystemModel in combination with setFilter() and QTreeView

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes