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

QFileDialog does not use passed name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.2
    • 5.0.1
    • None
    • Win 7
    • bfd73eaba3000861037d03787f87d1f4dafefea8

    Description

      QFileDialog does not use specified file name.

      If using static method QFileDialog::getSaveFileName in this way:

      ---------------------
      QString fileName = tr("foo.csv");
      fileName = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) +
      QLatin1String("/") + fileName;

      return QFileDialog::getSaveFileName
      (
      widget,
      tr("Please, select export file name"),
      fileName,
      tr("Csv files (.csv);;All files (.*)")
      );
      ---------------------

      we will not see specified file name in dialog. But if we will tune file dialog with option QFileDialog::DontUseNativeDialog

      -----------
      QString fileName = tr("foo.csv");
      fileName = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) +
      QLatin1String("/") + fileName;

      return QFileDialog::getSaveFileName
      (
      widget,
      tr("Please, select export file name"),
      fileName,
      tr("Csv files (.csv);;All files (.*)"),
      0,
      QFileDialog::DontUseNativeDialog
      );
      -----------

      we will able to see specified name.

      Previously, my application was based on Qt 4.8.4. And, as I remember, I was able to use native dialog and specify file name in the same time.

      Sorry for my English.

      Attachments

        1. QTBUG-29902.tgz
          0.6 kB
          Shawn Rutledge
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            kittyhawk Bohdan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes