diff --git a/src/corelib/kernel/qcoreapplication_platform.h b/src/corelib/kernel/qcoreapplication_platform.h index 8dc1199135..15d9abc3fc 100644 --- a/src/corelib/kernel/qcoreapplication_platform.h +++ b/src/corelib/kernel/qcoreapplication_platform.h @@ -57,6 +57,7 @@ struct Q_CORE_EXPORT QAndroidApplication QT_DECLARE_NATIVE_INTERFACE(QAndroidApplication) static jobject context(); static bool isActivityContext(); + static int sdkVersion(); }; #endif } diff --git a/src/corelib/platform/android/qandroidnativeinterface.cpp b/src/corelib/platform/android/qandroidnativeinterface.cpp index 74d21c5d4c..6096d21181 100644 --- a/src/corelib/platform/android/qandroidnativeinterface.cpp +++ b/src/corelib/platform/android/qandroidnativeinterface.cpp @@ -82,4 +82,15 @@ bool QNativeInterface::QAndroidApplication::isActivityContext() return QtAndroidPrivate::activity(); } +/*! + \fn int QNativeInterface::QAndroidApplication::sdkVersion() + + Returns the Android SDK version. This is also known as the API level. + + \since 6.2 +*/ +int QNativeInterface::QAndroidApplication::sdkVersion() +{ + return QtAndroidPrivate::androidSdkVersion(); +} QT_END_NAMESPACE