From 3708e445a0d18e012c328124adda246915eec811 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Tue, 17 Dec 2024 10:35:10 +0700 Subject: [PATCH] Remove obsolete #if Qt versioni checks --- .../android/androidplatformutilities.cpp | 168 +----------------- .../android/androidplatformutilities.h | 13 +- .../android/androidprojectsource.cpp | 20 +-- .../platforms/android/androidprojectsource.h | 8 - src/core/platforms/ios/iosplatformutilities.h | 2 - .../platforms/ios/iosplatformutilities.mm | 2 - src/core/qgismobileapp.cpp | 2 +- src/sentry/sentry_classic.cpp | 25 +-- src/service/qfieldservice.h | 7 +- vcpkg/ports/qtquick3d/portfile.cmake | 1 - 10 files changed, 12 insertions(+), 236 deletions(-) diff --git a/src/core/platforms/android/androidplatformutilities.cpp b/src/core/platforms/android/androidplatformutilities.cpp index 60dda87857..8587f0abe4 100644 --- a/src/core/platforms/android/androidplatformutilities.cpp +++ b/src/core/platforms/android/androidplatformutilities.cpp @@ -26,26 +26,6 @@ #include "qfield_android.h" #include "qfieldcloudconnection.h" - -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -#include -#include -#include - -inline QAndroidJniObject qtAndroidContext() -{ - auto result = QtAndroid::androidActivity(); - if ( result.isValid() ) - return result; - return QtAndroid::androidService(); -} - -inline void runOnAndroidMainThread( const QtAndroid::Runnable &runnable ) -{ - QtAndroid::runOnAndroidThread( runnable ); -} - -#else #include #include #include @@ -62,7 +42,6 @@ inline void runOnAndroidMainThread( const std::function &runnable ) return QVariant(); } ); } -#endif #include #include @@ -115,11 +94,7 @@ void AndroidPlatformUtilities::afterUpdate() auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject messageJni = QAndroidJniObject::fromString( QObject::tr( "Please wait while QField installation finalizes." ) ); -#else QJniObject messageJni = QJniObject::fromString( QObject::tr( "Please wait while QField installation finalizes." ) ); -#endif activity.callMethod( "showBlockingProgressDialog", "(Ljava/lang/String;)V", messageJni.object() ); } } ); @@ -173,11 +148,7 @@ QString AndroidPlatformUtilities::applicationDirectory() const { if ( mActivity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject rootDirs = mActivity.callObjectMethod( "getApplicationDirectory" ); -#else QJniObject rootDirs = mActivity.callObjectMethod( "getApplicationDirectory" ); -#endif if ( rootDirs.isValid() ) { return rootDirs.toString(); @@ -191,11 +162,7 @@ QStringList AndroidPlatformUtilities::additionalApplicationDirectories() const { if ( mActivity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject rootDirs = mActivity.callObjectMethod( "getAdditionalApplicationDirectories" ); -#else QJniObject rootDirs = mActivity.callObjectMethod( "getAdditionalApplicationDirectories" ); -#endif if ( rootDirs.isValid() ) { return rootDirs.toString().split( "--;--" ); @@ -209,11 +176,7 @@ QStringList AndroidPlatformUtilities::rootDirectories() const { if ( mActivity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject rootDirs = mActivity.callObjectMethod( "getRootDirectories" ); -#else QJniObject rootDirs = mActivity.callObjectMethod( "getRootDirectories" ); -#endif if ( rootDirs.isValid() ) { return rootDirs.toString().split( "--;--" ); @@ -273,11 +236,7 @@ void AndroidPlatformUtilities::updateProjectFromArchive( const QString &projectP auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject projectPathJni = QAndroidJniObject::fromString( projectPath ); -#else QJniObject projectPathJni = QJniObject::fromString( projectPath ); -#endif activity.callMethod( "triggerUpdateProjectFromArchive", "(Ljava/lang/String;)V", projectPathJni.object() ); } } ); @@ -298,11 +257,7 @@ void AndroidPlatformUtilities::sendDatasetTo( const QString &path ) const { paths << file; } -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject pathsJni = QAndroidJniObject::fromString( paths.join( "--;--" ) ); -#else QJniObject pathsJni = QJniObject::fromString( paths.join( "--;--" ) ); -#endif activity.callMethod( "sendDatasetTo", "(Ljava/lang/String;)V", pathsJni.object() ); } } ); @@ -323,11 +278,7 @@ void AndroidPlatformUtilities::exportDatasetTo( const QString &path ) const { paths << file; } -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject pathsJni = QAndroidJniObject::fromString( paths.join( "--;--" ) ); -#else QJniObject pathsJni = QJniObject::fromString( paths.join( "--;--" ) ); -#endif activity.callMethod( "exportToFolder", "(Ljava/lang/String;)V", pathsJni.object() ); } } ); @@ -342,11 +293,7 @@ void AndroidPlatformUtilities::removeDataset( const QString &path ) const auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject pathJni = QAndroidJniObject::fromString( path ); -#else QJniObject pathJni = QJniObject::fromString( path ); -#endif activity.callMethod( "removeDataset", "(Ljava/lang/String;)V", pathJni.object() ); } } ); @@ -361,11 +308,7 @@ void AndroidPlatformUtilities::exportFolderTo( const QString &path ) const auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject pathJni = QAndroidJniObject::fromString( path ); -#else QJniObject pathJni = QJniObject::fromString( path ); -#endif activity.callMethod( "exportToFolder", "(Ljava/lang/String;)V", pathJni.object() ); } } ); @@ -380,11 +323,7 @@ void AndroidPlatformUtilities::sendCompressedFolderTo( const QString &path ) con auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject pathJni = QAndroidJniObject::fromString( path ); -#else QJniObject pathJni = QJniObject::fromString( path ); -#endif activity.callMethod( "sendCompressedFolderTo", "(Ljava/lang/String;)V", pathJni.object() ); } } ); @@ -399,22 +338,14 @@ void AndroidPlatformUtilities::removeFolder( const QString &path ) const auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject pathJni = QAndroidJniObject::fromString( path ); -#else QJniObject pathJni = QJniObject::fromString( path ); -#endif activity.callMethod( "removeProjectFolder", "(Ljava/lang/String;)V", pathJni.object() ); } } ); } } -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -QString AndroidPlatformUtilities::getIntentExtra( const QString &extra, QAndroidJniObject extras ) const -#else QString AndroidPlatformUtilities::getIntentExtra( const QString &extra, QJniObject extras ) const -#endif { if ( extras == nullptr ) { @@ -422,11 +353,7 @@ QString AndroidPlatformUtilities::getIntentExtra( const QString &extra, QJniObje } if ( extras.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject extraJni = QAndroidJniObject::fromString( extra ); -#else QJniObject extraJni = QJniObject::fromString( extra ); -#endif extraJni = extras.callObjectMethod( "getString", "(Ljava/lang/String;)Ljava/lang/String;", extraJni.object() ); if ( extraJni.isValid() ) { @@ -436,29 +363,6 @@ QString AndroidPlatformUtilities::getIntentExtra( const QString &extra, QJniObje return QString(); } -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -QAndroidJniObject AndroidPlatformUtilities::getNativeIntent() const -{ - if ( mActivity.isValid() ) - { - QAndroidJniObject intent = mActivity.callObjectMethod( "getIntent", "()Landroid/content/Intent;" ); - return intent; - } - return nullptr; -} - -QAndroidJniObject AndroidPlatformUtilities::getNativeExtras() const -{ - QAndroidJniObject intent = getNativeIntent(); - if ( intent.isValid() ) - { - QAndroidJniObject extras = intent.callObjectMethod( "getExtras", "()Landroid/os/Bundle;" ); - - return extras; - } - return nullptr; -} -#else QJniObject AndroidPlatformUtilities::getNativeIntent() const { if ( mActivity.isValid() ) @@ -480,7 +384,6 @@ QJniObject AndroidPlatformUtilities::getNativeExtras() const } return nullptr; } -#endif ResourceSource *AndroidPlatformUtilities::processCameraActivity( const QString &prefix, const QString &filePath, const QString &suffix, bool isVideo, QObject *parent ) { @@ -500,15 +403,10 @@ ResourceSource *AndroidPlatformUtilities::processCameraActivity( const QString & auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject prefixJni = QAndroidJniObject::fromString( prefix ); - QAndroidJniObject filePathJni = QAndroidJniObject::fromString( filePath ); - QAndroidJniObject suffixJni = QAndroidJniObject::fromString( suffix ); -#else QJniObject prefixJni = QJniObject::fromString( prefix ); QJniObject filePathJni = QJniObject::fromString( filePath ); QJniObject suffixJni = QJniObject::fromString( suffix ); -#endif + QSettings().setValue( QStringLiteral( "QField/nativeCameraLaunched" ), true ); activity.callMethod( "getCameraResource", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V", prefixJni.object(), @@ -546,15 +444,10 @@ ResourceSource *AndroidPlatformUtilities::processGalleryActivity( const QString auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject prefixJni = QAndroidJniObject::fromString( prefix ); - QAndroidJniObject filePathJni = QAndroidJniObject::fromString( filePath ); - QAndroidJniObject mimeTypeJni = QAndroidJniObject::fromString( mimeType ); -#else QJniObject prefixJni = QJniObject::fromString( prefix ); QJniObject filePathJni = QJniObject::fromString( filePath ); QJniObject mimeTypeJni = QJniObject::fromString( mimeType ); -#endif + QSettings().setValue( QStringLiteral( "QField/nativeCameraLaunched" ), true ); activity.callMethod( "getGalleryResource", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", prefixJni.object(), @@ -603,15 +496,10 @@ ResourceSource *AndroidPlatformUtilities::getFile( const QString &prefix, const auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject prefixJni = QAndroidJniObject::fromString( prefix ); - QAndroidJniObject filePathJni = QAndroidJniObject::fromString( filePath ); - QAndroidJniObject mimeTypeJni = QAndroidJniObject::fromString( mimeType ); -#else QJniObject prefixJni = QJniObject::fromString( prefix ); QJniObject filePathJni = QJniObject::fromString( filePath ); QJniObject mimeTypeJni = QJniObject::fromString( mimeType ); -#endif + QSettings().setValue( QStringLiteral( "QField/nativeCameraLaunched" ), true ); activity.callMethod( "getFilePickerResource", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", prefixJni.object(), @@ -645,13 +533,9 @@ ViewStatus *AndroidPlatformUtilities::open( const QString &filePath, bool isEdit auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject filePathJni = QAndroidJniObject::fromString( filePath ); - QAndroidJniObject mimeTypeJni = QAndroidJniObject::fromString( mimeType ); -#else QJniObject filePathJni = QJniObject::fromString( filePath ); QJniObject mimeTypeJni = QJniObject::fromString( mimeType ); -#endif + QSettings().setValue( QStringLiteral( "QField/nativeCameraLaunched" ), true ); activity.callMethod( "openResource", "(Ljava/lang/String;Ljava/lang/String;Z)V", filePathJni.object(), @@ -667,13 +551,8 @@ bool AndroidPlatformUtilities::checkPositioningPermissions() const { // First check for coarse permissions. If the user configured QField to only get coarse permissions // it's his wish and we just let it be. -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QtAndroid::PermissionResult r = QtAndroid::checkPermission( "android.permission.ACCESS_COARSE_LOCATION" ); - if ( r == QtAndroid::PermissionResult::Denied ) -#else auto r = QtAndroidPrivate::checkPermission( "android.permission.ACCESS_COARSE_LOCATION" ).result(); if ( r == QtAndroidPrivate::Denied ) -#endif { return checkAndAcquirePermissions( "android.permission.ACCESS_FINE_LOCATION" ); } @@ -697,29 +576,6 @@ bool AndroidPlatformUtilities::checkWriteExternalStoragePermissions() const bool AndroidPlatformUtilities::checkAndAcquirePermissions( const QString &permissions ) const { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QStringList requestedPermissions = permissions.split( ';' ); - requestedPermissions.erase( std::remove_if( requestedPermissions.begin(), requestedPermissions.end(), - []( const QString &permission ) { - return QtAndroid::checkPermission( permission ) != QtAndroid::PermissionResult::Denied; - } ), - requestedPermissions.end() ); - - if ( !requestedPermissions.isEmpty() ) - { - QtAndroid::requestPermissionsSync( requestedPermissions ); - for ( const QString &permission : requestedPermissions ) - { - QtAndroid::PermissionResult r = QtAndroid::checkPermission( permission ); - if ( r == QtAndroid::PermissionResult::Denied ) - { - return false; - } - } - } - - return true; -#else QStringList requestedPermissions = permissions.split( ';' ); requestedPermissions.erase( std::remove_if( requestedPermissions.begin(), requestedPermissions.end(), []( const QString &permission ) { @@ -741,7 +597,6 @@ bool AndroidPlatformUtilities::checkAndAcquirePermissions( const QString &permis } return true; -#endif } void AndroidPlatformUtilities::setScreenLockPermission( const bool allowLock ) @@ -752,11 +607,7 @@ void AndroidPlatformUtilities::setScreenLockPermission( const bool allowLock ) auto activity = qtAndroidContext(); if ( activity.isValid() ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject window = activity.callObjectMethod( "getWindow", "()Landroid/view/Window;" ); -#else QJniObject window = activity.callObjectMethod( "getWindow", "()Landroid/view/Window;" ); -#endif if ( window.isValid() ) { @@ -772,11 +623,7 @@ void AndroidPlatformUtilities::setScreenLockPermission( const bool allowLock ) } } -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniEnvironment env; -#else QJniEnvironment env; -#endif if ( env->ExceptionCheck() ) { env->ExceptionClear(); @@ -851,17 +698,10 @@ void AndroidPlatformUtilities::uploadPendingAttachments( QFieldCloudConnection * if ( connection ) { qInfo() << "Launching service from main..."; -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject::callStaticMethod( "ch/opengis/" APP_PACKAGE_NAME "/QFieldService", - "startQFieldService", - "(Landroid/content/Context;)V", - qtAndroidContext().object() ); -#else QJniObject::callStaticMethod( "ch/opengis/" APP_PACKAGE_NAME "/QFieldService", "startQFieldService", "(Landroid/content/Context;)V", qtAndroidContext().object() ); -#endif } } ); } diff --git a/src/core/platforms/android/androidplatformutilities.h b/src/core/platforms/android/androidplatformutilities.h index 9f983c68b8..9934684ae0 100644 --- a/src/core/platforms/android/androidplatformutilities.h +++ b/src/core/platforms/android/androidplatformutilities.h @@ -21,11 +21,7 @@ #include "platformutilities.h" -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -#include -#else #include -#endif class AndroidPlatformUtilities : public PlatformUtilities { @@ -93,17 +89,12 @@ class AndroidPlatformUtilities : public PlatformUtilities bool checkAndAcquirePermissions( const QString &permissions ) const; ResourceSource *processCameraActivity( const QString &prefix, const QString &filePath, const QString &suffix, bool isVideo, QObject *parent = nullptr ); ResourceSource *processGalleryActivity( const QString &prefix, const QString &filePath, const QString &mimeType, QObject *parent = nullptr ); -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QString getIntentExtra( const QString &, QAndroidJniObject = nullptr ) const; - QAndroidJniObject getNativeIntent() const; - QAndroidJniObject getNativeExtras() const; - QAndroidJniObject mActivity; -#else + QString getIntentExtra( const QString &, QJniObject = nullptr ) const; + QJniObject getNativeIntent() const; QJniObject getNativeExtras() const; QJniObject mActivity; -#endif QString mSystemGenericDataLocation; }; diff --git a/src/core/platforms/android/androidprojectsource.cpp b/src/core/platforms/android/androidprojectsource.cpp index f980f01ab1..a82cb077d9 100644 --- a/src/core/platforms/android/androidprojectsource.cpp +++ b/src/core/platforms/android/androidprojectsource.cpp @@ -18,12 +18,8 @@ #include "qgsmessagelog.h" #include - -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -#include -#else #include -#endif + AndroidProjectSource::AndroidProjectSource( QObject *parent ) : ProjectSource( parent ) @@ -31,27 +27,13 @@ AndroidProjectSource::AndroidProjectSource( QObject *parent ) { } -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -void AndroidProjectSource::handleActivityResult( int receiverRequestCode, int resultCode, const QAndroidJniObject &data ) -#else void AndroidProjectSource::handleActivityResult( int receiverRequestCode, int resultCode, const QJniObject &data ) -#endif { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - jint RESULT_OK = QAndroidJniObject::getStaticField( "android/app/Activity", "RESULT_OK" ); -#else jint RESULT_OK = QJniObject::getStaticField( "android/app/Activity", "RESULT_OK" ); -#endif if ( receiverRequestCode == 103 && resultCode == RESULT_OK ) { -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - QAndroidJniObject uri = data.callObjectMethod( "getData", "()Landroid/net/Uri;" ); -#else QJniObject uri = data.callObjectMethod( "getData", "()Landroid/net/Uri;" ); -#endif - QString path = uri.callObjectMethod( "getPath", "()Ljava/lang/String;" ).toString(); - if ( !QFile( path ).exists() ) { QgsMessageLog::logMessage( tr( "File %1 does not exist" ).arg( path ), QStringLiteral( "QField" ), Qgis::Warning ); diff --git a/src/core/platforms/android/androidprojectsource.h b/src/core/platforms/android/androidprojectsource.h index 08178701e6..70a6fcebe3 100644 --- a/src/core/platforms/android/androidprojectsource.h +++ b/src/core/platforms/android/androidprojectsource.h @@ -20,11 +20,7 @@ #include "projectsource.h" -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -#include -#else #include -#endif class AndroidProjectSource : public ProjectSource, public QAndroidActivityResultReceiver { @@ -33,11 +29,7 @@ class AndroidProjectSource : public ProjectSource, public QAndroidActivityResult public: explicit AndroidProjectSource( QObject *parent = nullptr ); -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) - void handleActivityResult( int receiverRequestCode, int resultCode, const QAndroidJniObject &data ) override; -#else void handleActivityResult( int receiverRequestCode, int resultCode, const QJniObject &data ) override; -#endif }; #endif // ANDROIDPROJECTSOURCE_H diff --git a/src/core/platforms/ios/iosplatformutilities.h b/src/core/platforms/ios/iosplatformutilities.h index 8c596a7e4a..30368090d0 100644 --- a/src/core/platforms/ios/iosplatformutilities.h +++ b/src/core/platforms/ios/iosplatformutilities.h @@ -54,12 +54,10 @@ class IosPlatformUtilities : public PlatformUtilities double systemFontPointSize() const override { return 16.0; } bool isSystemDarkTheme() const override; -#if QT_VERSION >= QT_VERSION_CHECK( 6, 5, 0 ) Qt::PermissionStatus checkCameraPermission() const override; void requestCameraPermission( std::function func ) override; virtual Qt::PermissionStatus checkMicrophonePermission() const override; virtual void requestMicrophonePermission( std::function func ) override; -#endif }; #endif diff --git a/src/core/platforms/ios/iosplatformutilities.mm b/src/core/platforms/ios/iosplatformutilities.mm index 8ca04e1e9e..8b94626d72 100644 --- a/src/core/platforms/ios/iosplatformutilities.mm +++ b/src/core/platforms/ios/iosplatformutilities.mm @@ -192,7 +192,6 @@ - (void)documentInteractionControllerDidEndPreview: return false; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) Qt::PermissionStatus IosPlatformUtilities::checkCameraPermission() const { switch ([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]) { case AVAuthorizationStatusNotDetermined: { @@ -242,4 +241,3 @@ - (void)documentInteractionControllerDidEndPreview: : Qt::PermissionStatus::Denied); }]; } -#endif diff --git a/src/core/qgismobileapp.cpp b/src/core/qgismobileapp.cpp index 7793214bc3..e39f6c0ae9 100644 --- a/src/core/qgismobileapp.cpp +++ b/src/core/qgismobileapp.cpp @@ -365,7 +365,7 @@ QgisMobileapp::QgisMobileapp( QgsApplication *app, QObject *parent ) void QgisMobileapp::initDeclarative( QQmlEngine *engine ) { -#if defined( Q_OS_ANDROID ) && QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 ) +#if defined( Q_OS_ANDROID ) QResource::registerResource( QStringLiteral( "assets:/android_rcc_bundle.rcc" ) ); #endif engine->addImportPath( QStringLiteral( "qrc:/qml/imports" ) ); diff --git a/src/sentry/sentry_classic.cpp b/src/sentry/sentry_classic.cpp index a64d2bd218..39ed3ceec6 100644 --- a/src/sentry/sentry_classic.cpp +++ b/src/sentry/sentry_classic.cpp @@ -22,32 +22,14 @@ #include #include -#ifdef ANDROID -#include - -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -#include -#include -#include - -inline QAndroidJniObject qtAndroidContext() -{ - auto result = QtAndroid::androidActivity(); - if ( result.isValid() ) - return result; - return QtAndroid::androidService(); -} - -inline void runOnAndroidMainThread( const QtAndroid::Runnable &runnable ) -{ - QtAndroid::runOnAndroidThread( runnable ); -} -#else +#ifdef ANDROID #include #include #include +#include + inline QJniObject qtAndroidContext() { return QJniObject( QCoreApplication::instance()->nativeInterface()->context() ); @@ -61,7 +43,6 @@ inline void runOnAndroidMainThread( const std::function &runnable ) } ); } #endif -#endif namespace sentry_wrapper { diff --git a/src/service/qfieldservice.h b/src/service/qfieldservice.h index 1876f20448..8b5862532e 100644 --- a/src/service/qfieldservice.h +++ b/src/service/qfieldservice.h @@ -16,13 +16,8 @@ #include "qfield_service_export.h" -#include -#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) -#include -#include -#else #include -#endif +#include class QFIELD_SERVICE_EXPORT QFieldService : public QAndroidService { diff --git a/vcpkg/ports/qtquick3d/portfile.cmake b/vcpkg/ports/qtquick3d/portfile.cmake index 817017816d..8efdcf7893 100644 --- a/vcpkg/ports/qtquick3d/portfile.cmake +++ b/vcpkg/ports/qtquick3d/portfile.cmake @@ -24,7 +24,6 @@ qt_install_submodule(PATCHES ${${PORT}_PATCHES} TOOL_NAMES ${TOOL_NAMES} CONFIGURE_OPTIONS ${FEATURE_OPTIONS} - -DQT_FEATURE_quick3dxr_openxr=OFF -DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON CONFIGURE_OPTIONS_RELEASE CONFIGURE_OPTIONS_DEBUG