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

FileDialog unwanted uri suffix for Android11 SAF

    XMLWordPrintable

    Details

    • Platform/s:
      Android
    • Story Points:
      8
    • Commits:
      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)
    • Sprint:
      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

          For Gerrit Dashboard: QTBUG-94391
          # Subject Branch Project Status CR V

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews