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

QFileDialog::selectFile does not keep native separators

XMLWordPrintable

    • 19c701d37 (dev), 4938b234a (6.7), 93ed05edf (6.6), 2643210bd (dev), 3252ef72d (6.7), 55d4ee658 (6.6)

      We have a rather modularised application where a core library allows opening a file save dialog. While writing a test, I tried popping up the file dialog, set a predetermined file name, then check if that value was propagated properly across the layers in the application.

      This is on Windows, so I tried
      ```
      dialog->selectFile(QDir::toNativeSeparators(file.fileName()));
      ```
      However, this dialog that opens, does not have native separators, resulting in the test failing, because hitting enter results in Windows telling me I entered an invalid path.

      I tried creating a simple example that shows the issue. It tried to strip as much as possible.

        1. Example.cpp
          1 kB
        2. MenuExtensions.h
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jsvanbethlehem J van Bethlehem
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: