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

Move QFileSystemModel to Qt GUI

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • None
    • None
    • Other
    • None

    Description

      I was wondering why QFileSystemModel wouldn't get noticed by Creator until I checked its doc and saw that it's in widgets for some reason. And that reason is:

      #if QT_CONFIG(messagebox)
              QMessageBox::information(0, QFileSystemModel::tr("Invalid filename"),
                                      QFileSystemModel::tr("<b>The name \"%1\" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks.")
                                      .arg(newName),
                                       QMessageBox::Ok);
      #endif // QT_CONFIG(messagebox)
      

      http://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/dialogs/qfilesystemmodel.cpp#n877

      The mind boggles.

      This is completely the wrong place for something like this. The error should be reported in some other way, and then client code can do what they want with it.

      Another strange thing is that it's in src/widgets/dialogs.

      I was planning on using QFileSystemModel to serve as the logic behind a save game dialog, with a QSortFilterProxyModel on top of it to validate the save files to ensure that they're actually save files. Having QFileSystemModel available in Qt GUI so that Qt Quick-only applications can use it would be really helpful.

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              mitch_curtis Mitch Curtis
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews