[Interest] Qt6: Android: checkPermission is not available yet?

Alexander Dyagilev alervdvcw at gmail.com
Sat Sep 18 18:24:06 CEST 2021


Hello guys :)

I'm wondering that is the equivalent for this function:

bool checkPermission()
{
     static const QString 
PERMISSION("android.permission.WRITE_EXTERNAL_STORAGE");
     QtAndroid::PermissionResult r = QtAndroid::checkPermission(PERMISSION);
     if (r == QtAndroid::PermissionResult::Denied)
     {
         QtAndroid::requestPermissionsSync(QStringList() << PERMISSION);
         r = QtAndroid::checkPermission(PERMISSION);
         if (r == QtAndroid::PermissionResult::Denied)
             return false;
     }
     return true;
}

It seems it does not exist?

I've tried this (Qt 6.2 RC):

#include <QtCore/6.2.0/QtCore/private/qandroidextras_p.h>
QtAndroidPrivate::checkPermission(QtAndroidPrivate::Storage);

It can't be compiled due to the following error: fatal error: 
'QtCore/private/qglobal_p.h' file not found



More information about the Interest mailing list