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

Qt on android needs a built-in way to convert Android URIs to real paths

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Won't Do
    • Icon: P4: Low P4: Low
    • 6.x
    • 5.14.2
    • Extras: Android
    • None
    • Android
    • 2022wk44FOQtforAndroid, 2022wk46FOQtforAndroid, 2022wk48FOQtforAndroid, 2022wk50FOQtforAndroid, 2022wk52FOQtforAndroid

      Android doesn't use normal URIs like:

      file:///path_to_file
      

       Instead of that, in content providers you will have something like this:

      content://com.example.app.provider/a_lot_of_data
      

      This format can be different in Android activities which provide any files (FileDialog.fileUrl in QML) or only images (not implemented in Qt, I implemented it myself in my project, see PhotoDialog). That's why we need a build-in way to convert these URIs to normal paths, like a function:

      QString QtAndroid::uriToRealPath(const QString &uri);
      

       
      I have examples of implementation in my project:

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

            assam Assam Boudjelthia
            monsterovich monsterovich
            Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes