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

Move QFileSystemModel to Qt GUI

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Other
    • Labels:
      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

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

          Activity

            People

            • Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              mitch_curtis Mitch Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes