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

FileDialog unwanted uri suffix for Android11 SAF

    XMLWordPrintable

Details

    • Android
    • 8
    • d10d1f97d0 (qt/qtdeclarative/dev) b844ee29dd (qt/qtdeclarative/6.3) b844ee29dd (qt/tqtc-qtdeclarative/6.3) d10d1f97d0 (qt/tqtc-qtdeclarative/dev) fb9d2be11e (qt/tqtc-qtquickcontrols2/5.15) b844ee29dd (qt/tqtc-qtdeclarative/6.3.0)
    • Team A Foundation Sprint 53, Team A Foundation Sprint 54

    Description

       

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import Qt.labs.platform 1.1
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
          title: qsTr("Test")
          Image {
              source: fileDialog.file
          }
          Button{
              text: "Open"
              onClicked: {
                  fileDialog.open()
              }
          }
          FileDialog {
              id: fileDialog
              defaultSuffix: "jpg"
              onAccepted: {
                  console.log(file)
              }
          }
      }

      This code works fine on the desktop

       

      But on Android 11 it will return uri:

      content://com.android.providers.media.documents/document/image:36.jpg
      

      Here .jpg is redundant and unnecessary

      This caused the file to fail to open

       

      Attachments

        Issue Links

          Activity

            People

              ivan.solovev Ivan Solovev
              yjbeetle yjbeetle
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: