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

QFileDialog::getExistingDirectory causes a warning in QWindowsNativeFileDialogBase::selectNameFilter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.1.0
    • Core: Plugins
    • None
    • Windows 7 Service Pack 1

      Calling QFileDialog::getExistingDirectory with default parameters:

      QString Path = "C:\";
      QFileDialog::getExistingDirectory( this, "Choose Directory", Path );

      Generates a warning in QWindowsNativeFileDialogBase::selectNameFilter:

      "QWindowsNativeFileDialogBase::selectNameFilter: Invalid parameter 'Directories' not found in 'All Files '."

      When the QWindowsNativeFileDialogBase is being created it gets a default name filter of "All Files " even though QFileDialogOptionsPrivate::initiallySelectedNameFilter is set to "Directories".

      Unfortunately there is no work around as you can't pass a filter in to getExistingDirectory to override the incorrect initial value.

      There was a similar bug reported https://bugreports.qt-project.org/browse/QTBUG-30001 which was closed and reported as fixed but this is still an issue in later versions of Qt with that fix applied.

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

            kleint Friedemann Kleint
            fun4jimmy James Whitworth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes