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

QFileDialog::getOpenFileName always returns empty string on Android

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Xiaomi Mi 5, with MIUI 10.2 (Android 8.0).
    • Platform/s:
      Android

      Description

      I have working code (on Windows & Linux) that I compiled for Android: https://github.com/MayaPosch/NymphCast/tree/master/player/NymphCastPlayer

      Everything works just like on Linux and Windows, except that when I try to open a local file, I cannot get a file path back from getOpenFileName(). When this function is called, I do get the native Android (Android 8) file picker dialogue for local files, and I can select anything.

      Yet the return value is always an empty string. This happens with Qt 5.13.2 and 5.14.2, and with a somewhat older SDK & NDK (20.x), as well as the (as of writing) latest SDK & NDK (21).

      I have made sure that the AndroidManifest has the 'android.permission.WRITE_EXTERNAL_STORAGE' and 'android.permission.READ_EXTERNAL_STORAGE' permissions.

      I'm running the APK on a Xiaomi Mi 5, with MIUI 10.2 (Android 8.0).

       

      Since QFileDialog::getOpenFileName() clearly calls an Intent, it would make sense that it would also have provisions to get the results from said Intent. If this has been implemented, it does not appear to be working.

        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:
            hackkitten Maya Posch
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes