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

FileDialog lost the ability to select folders

    XMLWordPrintable

Details

    Description

      Hi,

      This is for the FileDialog QML component in the "QtQuick.Dialogs" import.

      In Qt5 there was the `selectFolder` property https://doc.qt.io/qt-5/qml-qtquick-dialogs-filedialog.html#selectFolder-prop this allowed selecting a folder in the dialog.

      In Qt6 this property is completely gone https://doc.qt.io/qt-6/qml-qtquick-dialogs-filedialog.html 

      What's the correct way in QML for Qt 6 to select a folder?

      I refuse to use the FolderDialog from the `Qt.labs.platform` import https://doc.qt.io/qt-6/qml-qt-labs-platform-folderdialog.html because it's in labs.

       

      Also, let me very explicitly remark that the `selectFolder` property had not been marked as deprecated at all! Why is it gone?

      When i'm looking at the sources i'm truly amazed, yet again. Tends to be a think Qt does to me quite often these days with the QML state. And that's not a compliment.

      https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quickdialogs2/quickdialogs2

      When looking through that source it seems like there is going to be a FolderDialog. But that's for Qt 6.3 which at the moment of writing this bug report hasn't been released yet! Also it's in a "quickdialogs2" folder. Is there going to be a "QtQuick.Dialogs*2*" import? Or is this yet another naming inconsistency? (thinking about controls that has the same naming mess).

      So my thinking is.. This can't be right, back to the 6.2 source.

      https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quickdialogs2/quickdialogs2?h=6.2

      There i do see what i expect (the folder name is still throwing me off but I'll just assume that's the correct folder).  Digging in https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quickdialogs2/quickdialogs2/qquickfiledialog_p.h?h=6.2 i can see that it just outright misses the "selectFolder" property there. So who removed it? As this is 100% certainly an API/ABI breakage.

      The earliest it appears in that repository is https://code.qt.io/cgit/qt/qtdeclarative.git/commit/src/quickdialogs2/quickdialogs2/qquickfiledialog_p.h?h=6.2&id=f9421abbdf4d2e2be06febf9f75a2b62e6875835 where it's already missing the property.

      That's where I've lost track of it.

      It "seems" to be a new implementation. And while that is probably good, you can't just break API. This only helps in giving an impression of an immature project (which Qt shouldn't be).

      How do i fix this in Qt 6.2.x?

      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
            markg85 Mark
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes