Unsolved No permission to open file on Android with Qt 5.15
I want to open a PDF file in Qt 5.15 on Android. I use
to open the file. In Qt 5.15 this function should work on Android. (Bugfix from here: QTBUG-45585)
Unfortunately I always get the error:
Qt JAVA : openURL(): No permissions to open Uri
If I test the permissions:
qDebug() << "file: " << file; QFile f(file); qDebug() << "file exists: " << f.exists(); f.setPermissions(QFileDevice::ReadUser | QFileDevice::WriteUser); qDebug() << f.permissions();
I get the following:
/storage/emulated/0/Documents/doc.pdf file exists: true QFlags(0x20|0x40|0x200|0x400|0x2000|0x4000)
I have set android permissions for READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in manifest.xml and also proofed the permission by:
QtAndroid::PermissionResult r = QtAndroid::checkPermission("android.permission.READ_EXTERNAL_STORAGE"); if(r == QtAndroid::PermissionResult::Granted) ...
If I generate a FileDialog to open the PDF there is no issue - the file opens normally.
Does anyone have an idea or has anyone solved a similar problem?
I opened a bug about this issue: QTBUG-85011