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

Use of QFileDialog::DontUseNativeDialog crashes on some system and not using flag crashes on others

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 5.7.0
    • None

    Description

      QFileDialog::getSaveFileName() crashes on Win 7, with  QFileDialog::Option::DontUseNativeDialog flag it does not. However

      QFileDialog::getSaveFileName() with QFileDialog::Option::DontUseNativeDialog crashes on win 8 Pro.

      So on what system property/basis should i determine whether to use DontUseNativeDialog flag or not?

      Sample code.

      #include <QtCore\qfile.h>
      #include <QtWidgets\qfiledialog.h>
      #include <QtWidgets\qapplication.h>
      #include <iostream>
      
      int main(int argc, char* argv[])
      {
          const char* Title = "Open";
          const char* Dir = "D:\\test";
          const char* Filter = "*.cpp";
      
          QApplication* QApp = new QApplication(argc, argv);
      
          QWidget window;
          window.setFixedSize(500, 500);
      
          //QString f = QFileDialog::getSaveFileName(0, Title, 0, Filter, 0);
      
          QString f = QFileDialog::getSaveFileName(0, Title, Dir, Filter, 0, QFileDialog::Option::DontUseNativeDialog);
      
          if (f.isEmpty() == true)
          {
              std::cout << "No Flag, butEmpty file name\n";
          }
          else
          {
              char FileName[100];
              strcpy(FileName, f.toLatin1().data());
      
              std::cout << "No flag Filename: " << FileName << "\n";
          }
      
          return 0;
      }
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            rdhotre Reshma Dhotre
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes