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

QFileDialog does not open read-only file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0 Alpha
    • 5.2.1
    • None
    • Windows 7, Qt 5.2.1, VS2010
    • a0ebaca9cbffe11d9854d65157c9c2486451e298 (stable, 26.2.2014, 5.3)

    Description

      Using a modal native dialog on Windows to open a read-only file does not work. It will open a dialog saying: “This file is set to read-only. Try again with a different file name.” Code below can be used to reproduce the problem (try opening a read-only file):

      QFileDialog dlg(this);
      dlg.setOption(QFileDialog::DontUseNativeDialog, false);
      dlg.setAcceptMode(QFileDialog::AcceptOpen);
      QStringList fileNames;
      if (dlg.exec())
          fileNames = dlg.selectedFiles();
      

      It’s possible to open the read-only file with the Qt dialog. Also the static function, QFileDialog::getOpenFileName() is able to open the read-only file.

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes