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

QFileSystemModel::isDir returns 'true' for a non-existent directory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.3.1
    • Core: Item Models
    • None
    • All

    Description

      QFileSystemModel::isDir returns 'true' for a non-existent directory. This is not what e.g. QFileDialog expects. The attached example executes a QFileDialog, where a directory "DoesNotExist" is added to the history (aka "Recent places"). Press "Test" to show the file dialog, then show the popup of the "Look in" combo box. You will see the "DoesNotExist" in the list.

      QUrlModel::addUrls (called by QFileDialogComboBox::showPopup) tries to skip the non-existent directory, but this does not work due to the behaviour of QFileSystemModel::isDir. Code snippets of QFileDialogComboBox::showPopup, QUrlModel::addUrls and QFileSystemModel::isDir are part of the attachment, search for "// <==" to find the relevant lines.

       

       

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            wschenke Winfried Schenke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes