Important: Please read the Qt Code of Conduct -

iOS: access files in asset library

  • I'm currently porting my app to iOS.

    One functionality is that the user can select images via QML FileDialog from the device photo gallery and add them to the app. On Android this is working fine with QFile, QFileInfo or QImage and the provided content-URL, if the necessary rights are granted.

    In iOS FileDialog provides a asset-library URL like this one:

    Using this with QFileInfo, exists() is true for some files and false for the others. If it's true, then QFileInfo doesn't contain any usable information. For example file size is 0, creation time is invalid and mime type is application/x-zerosize.

    In info.plist the following rights are requested:
    <string>The app wants to access the camera..</string>
    <string>The app wants to access the photo gallery.</string>

    I'm using Qt 5.15.1 and testing with iOS 14.2 (emulator).

    Any ideas what I'm missing? Or isn't it possible to access these files via QFile?

Log in to reply