diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 940b3732981..317b72722b5 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -495,7 +495,7 @@ bool AndroidBuildApkStep::init() return false; } - if (version->qtVersion() < QVersionNumber(5, 4, 0)) { + if (version->qtVersion() < AndroidManager::firstQtWithAndroidDeployQt) { const QString error = Tr::tr("The minimum Qt version required for Gradle build to work is %1. " "It is recommended to install the latest Qt version.") .arg("5.4.0"); diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 6e520d3721b..459bdb6eead 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -149,7 +149,7 @@ AndroidDeployQtStep::AndroidDeployQtStep(BuildStepList *parent, Id id) m_uninstallPreviousPackage.setValue(false); const QtSupport::QtVersion * const qt = QtSupport::QtKitAspect::qtVersion(kit()); - const bool forced = qt && qt->qtVersion() < QVersionNumber(5, 4, 0); + const bool forced = qt && qt->qtVersion() < AndroidManager::firstQtWithAndroidDeployQt; if (forced) { m_uninstallPreviousPackage.setValue(true); m_uninstallPreviousPackage.setEnabled(false); @@ -277,7 +277,7 @@ bool AndroidDeployQtStep::init() if (m_uninstallPreviousPackageRun) m_manifestName = AndroidManager::manifestPath(target()); - m_useAndroiddeployqt = version->qtVersion() >= QVersionNumber(5, 4, 0); + m_useAndroiddeployqt = version->qtVersion() >= AndroidManager::firstQtWithAndroidDeployQt; if (m_useAndroiddeployqt) { const QString buildKey = target()->activeBuildKey(); const ProjectNode *node = target()->project()->findNodeForBuildKey(buildKey); diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 7a141b58ce5..f3b9302d13c 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -35,6 +35,9 @@ public: namespace AndroidManager { +// With Qt 5.4, a couple of android tooling features moved over from Qt Creator to Qt. +constexpr auto firstQtWithAndroidDeployQt = {5, 4, 0}; + QString packageName(const ProjectExplorer::Target *target); QString packageName(const Utils::FilePath &manifestFile); QString activityName(const ProjectExplorer::Target *target); diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp index 7c334476a21..8f50666419a 100644 --- a/src/plugins/android/createandroidmanifestwizard.cpp +++ b/src/plugins/android/createandroidmanifestwizard.cpp @@ -228,7 +228,7 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSyste const QList buildTargets = buildSystem->applicationTargets(); QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(buildSystem->kit()); - m_copyGradle = version && version->qtVersion() >= QVersionNumber(5, 4, 0); + m_copyGradle = version && version->qtVersion() >= AndroidManager::firstQtWithAndroidDeployQt; if (buildTargets.isEmpty()) { // oh uhm can't create anything @@ -277,7 +277,7 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles() QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit()); if (!version) return; - if (version->qtVersion() < QVersionNumber(5, 4, 0)) { + if (version->qtVersion() < AndroidManager::firstQtWithAndroidDeployQt) { FileUtils::copyRecursively(version->prefix() / "src/android/java/AndroidManifest.xml", m_directory / "AndroidManifest.xml", nullptr,