forked from qt-creator/qt-creator
Replace QtSupport::QtVersionNumber with QVersionNumber
Task-number: QTCREATORBUG-27786 Change-Id: I71a44709c264829f629c9dfce702076eda297a77 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -287,7 +287,7 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup()
|
||||
|
||||
auto vbox = new QVBoxLayout(group);
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(m_step->kit());
|
||||
if (version && version->qtVersion() >= QtSupport::QtVersionNumber{5, 14}) {
|
||||
if (version && version->qtVersion() >= QVersionNumber(5, 14)) {
|
||||
auto buildAAB = new QCheckBox(tr("Build Android App Bundle (*.aab)"), group);
|
||||
buildAAB->setChecked(m_step->buildAAB());
|
||||
connect(buildAAB, &QAbstractButton::toggled, m_step, &AndroidBuildApkStep::setBuildAAB);
|
||||
@@ -505,7 +505,7 @@ bool AndroidBuildApkStep::init()
|
||||
reportWarningOrError(error, Task::Error);
|
||||
return false;
|
||||
}
|
||||
} else if (version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) {
|
||||
} else if (version->qtVersion() < QVersionNumber(5, 4, 0)) {
|
||||
const QString error = 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");
|
||||
@@ -585,7 +585,7 @@ bool AndroidBuildApkStep::init()
|
||||
|
||||
// Must be the last option, otherwise androiddeployqt might use the other
|
||||
// params (e.g. --sign) to choose not to add gdbserver
|
||||
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) {
|
||||
if (version->qtVersion() >= QVersionNumber(5, 6, 0)) {
|
||||
if (m_addDebugger || buildType() == ProjectExplorer::BuildConfiguration::Debug)
|
||||
arguments << "--gdbserver";
|
||||
else
|
||||
@@ -729,8 +729,8 @@ void AndroidBuildApkStep::doRun()
|
||||
"not be created.").arg(androidLibsDir.toUserOutput()),
|
||||
Task::Error);
|
||||
return false;
|
||||
} else if (version->qtVersion() >= QtSupport::QtVersionNumber{6, 0, 0}
|
||||
&& version->qtVersion() <= QtSupport::QtVersionNumber{6, 1, 1}) {
|
||||
} else if (version->qtVersion() >= QVersionNumber(6, 0, 0)
|
||||
&& version->qtVersion() <= QVersionNumber(6, 1, 1)) {
|
||||
// 6.0.x <= Qt <= 6.1.1 used to need a manaul call to _prepare_apk_dir target,
|
||||
// and now it's made directly with ALL target, so this code below ensures
|
||||
// these versions are not broken.
|
||||
|
@@ -318,14 +318,14 @@ void AndroidConfig::parseDependenciesJson()
|
||||
}
|
||||
|
||||
auto fillQtVersionsRange = [](const QString &shortVersion) {
|
||||
QList<QtVersionNumber> versions;
|
||||
QList<QVersionNumber> versions;
|
||||
const QRegularExpression re(R"(([0-9]\.[0-9]+\.)\[([0-9]+)\-([0-9]+)\])");
|
||||
QRegularExpressionMatch match = re.match(shortVersion);
|
||||
if (match.hasMatch() && match.lastCapturedIndex() == 3)
|
||||
for (int i = match.captured(2).toInt(); i <= match.captured(3).toInt(); ++i)
|
||||
versions.append(QtVersionNumber(match.captured(1) + QString::number(i)));
|
||||
versions.append(QVersionNumber::fromString(match.captured(1) + QString::number(i)));
|
||||
else
|
||||
versions.append(QtVersionNumber(shortVersion + ".-1"));
|
||||
versions.append(QVersionNumber::fromString(shortVersion + ".-1"));
|
||||
|
||||
return versions;
|
||||
};
|
||||
@@ -1010,7 +1010,7 @@ bool AndroidConfig::sdkToolsOk() const
|
||||
|
||||
QStringList AndroidConfig::essentialsFromQtVersion(const QtVersion &version) const
|
||||
{
|
||||
QtVersionNumber qtVersion = version.qtVersion();
|
||||
QVersionNumber qtVersion = version.qtVersion();
|
||||
for (const SdkForQtVersions &item : m_specificQtVersions)
|
||||
if (item.containsVersion(qtVersion))
|
||||
return item.essentialPackages;
|
||||
@@ -1020,9 +1020,8 @@ QStringList AndroidConfig::essentialsFromQtVersion(const QtVersion &version) con
|
||||
|
||||
QString AndroidConfig::ndkPathFromQtVersion(const QtVersion &version) const
|
||||
{
|
||||
QtVersionNumber qtVersion(version.qtVersionString());
|
||||
for (const SdkForQtVersions &item : m_specificQtVersions)
|
||||
if (item.containsVersion(qtVersion))
|
||||
if (item.containsVersion(version.qtVersion()))
|
||||
return item.ndkPath;
|
||||
|
||||
return m_defaultSdkDepends.ndkPath;
|
||||
@@ -1033,10 +1032,11 @@ QStringList AndroidConfig::defaultEssentials() const
|
||||
return m_defaultSdkDepends.essentialPackages + m_commonEssentialPkgs;
|
||||
}
|
||||
|
||||
bool SdkForQtVersions::containsVersion(const QtVersionNumber &qtVersion) const
|
||||
bool SdkForQtVersions::containsVersion(const QVersionNumber &qtVersion) const
|
||||
{
|
||||
return versions.contains(qtVersion)
|
||||
|| versions.contains(QtVersionNumber(qtVersion.majorVersion, qtVersion.minorVersion));
|
||||
|| versions.contains(QVersionNumber(qtVersion.majorVersion(),
|
||||
qtVersion.minorVersion()));
|
||||
}
|
||||
|
||||
FilePath AndroidConfig::openJDKLocation() const
|
||||
|
@@ -49,12 +49,12 @@ public:
|
||||
|
||||
struct SdkForQtVersions
|
||||
{
|
||||
QList<QtSupport::QtVersionNumber> versions;
|
||||
QList<QVersionNumber> versions;
|
||||
QStringList essentialPackages;
|
||||
QString ndkPath;
|
||||
|
||||
public:
|
||||
bool containsVersion(const QtSupport::QtVersionNumber &qtVersion) const;
|
||||
bool containsVersion(const QVersionNumber &qtVersion) const;
|
||||
};
|
||||
|
||||
class ANDROID_EXPORT AndroidConfig
|
||||
|
@@ -75,7 +75,7 @@ AndroidDeployQtStep::AndroidDeployQtStep(BuildStepList *parent, Utils::Id id)
|
||||
m_uninstallPreviousPackage->setValue(false);
|
||||
|
||||
const QtSupport::QtVersion * const qt = QtSupport::QtKitAspect::qtVersion(kit());
|
||||
const bool forced = qt && qt->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0);
|
||||
const bool forced = qt && qt->qtVersion() < QVersionNumber(5, 4, 0);
|
||||
if (forced) {
|
||||
m_uninstallPreviousPackage->setValue(true);
|
||||
m_uninstallPreviousPackage->setEnabled(false);
|
||||
@@ -203,7 +203,7 @@ bool AndroidDeployQtStep::init()
|
||||
if (m_uninstallPreviousPackageRun)
|
||||
m_manifestName = AndroidManager::manifestPath(target());
|
||||
|
||||
m_useAndroiddeployqt = version->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0);
|
||||
m_useAndroiddeployqt = version->qtVersion() >= QVersionNumber(5, 4, 0);
|
||||
if (m_useAndroiddeployqt) {
|
||||
const QString buildKey = target()->activeBuildKey();
|
||||
const ProjectNode *node = target()->project()->findNodeForBuildKey(buildKey);
|
||||
|
@@ -232,7 +232,7 @@ FilePath AndroidManager::androidBuildDirectory(const Target *target)
|
||||
bool AndroidManager::isQt5CmakeProject(const ProjectExplorer::Target *target)
|
||||
{
|
||||
const QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit());
|
||||
const bool isQt5 = qt && qt->qtVersion() < QtSupport::QtVersionNumber{6, 0, 0};
|
||||
const bool isQt5 = qt && qt->qtVersion() < QVersionNumber(6, 0, 0);
|
||||
const Core::Context cmakeCtx = Core::Context(CMakeProjectManager::Constants::CMAKE_PROJECT_ID);
|
||||
const bool isCmakeProject = (target->project()->projectContext() == cmakeCtx);
|
||||
return isQt5 && isCmakeProject;
|
||||
@@ -429,9 +429,9 @@ void AndroidManager::setDeviceApiLevel(Target *target, int level)
|
||||
|
||||
int AndroidManager::defaultMinimumSDK(const QtSupport::QtVersion *qtVersion)
|
||||
{
|
||||
if (qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber{6, 0})
|
||||
if (qtVersion && qtVersion->qtVersion() >= QVersionNumber(6, 0))
|
||||
return 23;
|
||||
else if (qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber{5, 13})
|
||||
else if (qtVersion && qtVersion->qtVersion() >= QVersionNumber(5, 13))
|
||||
return 21;
|
||||
else
|
||||
return 16;
|
||||
|
@@ -1204,7 +1204,7 @@ void AndroidManifestEditorWidget::addServiceMetadata(QXmlStreamWriter &writer)
|
||||
const Target *target = androidTarget(m_textEditorWidget->textDocument()->filePath());
|
||||
if (target) {
|
||||
const QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit());
|
||||
if (qt && qt->qtVersion() >= QtSupport::QtVersionNumber(6, 2))
|
||||
if (qt && qt->qtVersion() >= QVersionNumber(6, 2))
|
||||
return;
|
||||
}
|
||||
writeMetadataElement("android.app.qt_sources_resource_id", "android:resource", "@array/qt_sources", writer);
|
||||
|
@@ -144,8 +144,8 @@ void AndroidPackageInstallationStep::doRun()
|
||||
// Needed for Qt 5.15.0 and Qt 5.14.x versions
|
||||
if (buildType() == BuildConfiguration::BuildType::Debug) {
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit());
|
||||
if (version && version->qtVersion() >= QtSupport::QtVersionNumber{5, 14}
|
||||
&& version->qtVersion() <= QtSupport::QtVersionNumber{5, 15, 0}) {
|
||||
if (version && version->qtVersion() >= QVersionNumber(5, 14)
|
||||
&& version->qtVersion() <= QVersionNumber(5, 15, 0)) {
|
||||
const QString assetsDebugDir = nativeAndroidBuildPath().append(
|
||||
"/assets/--Added-by-androiddeployqt--/");
|
||||
QDir dir;
|
||||
|
@@ -68,8 +68,7 @@ QString AndroidQtVersion::invalidReason() const
|
||||
|
||||
bool AndroidQtVersion::supportsMultipleQtAbis() const
|
||||
{
|
||||
return qtVersion() >= QtSupport::QtVersionNumber{5, 14}
|
||||
&& qtVersion() < QtSupport::QtVersionNumber{6, 0};
|
||||
return qtVersion() >= QVersionNumber(5, 14) && qtVersion() < QVersionNumber(6, 0);
|
||||
}
|
||||
|
||||
Abis AndroidQtVersion::detectQtAbis() const
|
||||
|
@@ -290,7 +290,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
|
||||
<< ", Debug server path:" << m_debugServerPath;
|
||||
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit());
|
||||
m_useAppParamsForQmlDebugger = version->qtVersion() >= QtSupport::QtVersionNumber(5, 12);
|
||||
m_useAppParamsForQmlDebugger = version->qtVersion() >= QVersionNumber(5, 12);
|
||||
}
|
||||
|
||||
AndroidRunnerWorker::~AndroidRunnerWorker()
|
||||
|
@@ -232,7 +232,7 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSyste
|
||||
|
||||
const QList<BuildTargetInfo> buildTargets = buildSystem->applicationTargets();
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(buildSystem->kit());
|
||||
m_copyGradle = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0);
|
||||
m_copyGradle = version && version->qtVersion() >= QVersionNumber(5, 4, 0);
|
||||
|
||||
if (buildTargets.isEmpty()) {
|
||||
// oh uhm can't create anything
|
||||
@@ -281,7 +281,7 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit());
|
||||
if (!version)
|
||||
return;
|
||||
if (version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) {
|
||||
if (version->qtVersion() < QVersionNumber(5, 4, 0)) {
|
||||
FileUtils::copyRecursively(version->prefix() / "src/android/java/AndroidManifest.xml",
|
||||
m_directory / "AndroidManifest.xml",
|
||||
nullptr,
|
||||
|
@@ -1469,9 +1469,9 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
|
||||
auto sdkLocation = bs->data(Android::Constants::SdkLocation).value<FilePath>();
|
||||
|
||||
if (qt && qt->qtVersion() >= QtSupport::QtVersionNumber{6, 0, 0}) {
|
||||
if (qt && qt->qtVersion() >= QVersionNumber(6, 0, 0)) {
|
||||
// Don't build apk under ALL target because Qt Creator will handle it
|
||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber{6, 1, 0})
|
||||
if (qt->qtVersion() >= QVersionNumber(6, 1, 0))
|
||||
cmd.addArg("-DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL:BOOL=ON");
|
||||
cmd.addArg("-DQT_HOST_PATH:PATH=%{Qt:QT_HOST_PREFIX}");
|
||||
cmd.addArg("-DANDROID_SDK_ROOT:PATH=" + sdkLocation.path());
|
||||
@@ -1482,7 +1482,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
|
||||
const IDevice::ConstPtr device = DeviceKitAspect::device(k);
|
||||
if (CMakeBuildConfiguration::isIos(k)) {
|
||||
if (qt && qt->qtVersion().majorVersion >= 6) {
|
||||
if (qt && qt->qtVersion().majorVersion() >= 6) {
|
||||
// TODO it would be better if we could set
|
||||
// CMAKE_SYSTEM_NAME=iOS and CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES
|
||||
// and build with "cmake --build . -- -arch <arch>" instead of setting the architecture
|
||||
@@ -1507,7 +1507,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
}
|
||||
|
||||
if (isWebAssembly(k) || isQnx(k) || isWindowsARM64(k)) {
|
||||
if (qt && qt->qtVersion().majorVersion >= 6)
|
||||
if (qt && qt->qtVersion().majorVersion() >= 6)
|
||||
cmd.addArg(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
|
||||
}
|
||||
|
||||
|
@@ -1157,7 +1157,7 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const
|
||||
const ToolChain *const tcCxx = ToolChainKitAspect::cxxToolChain(k);
|
||||
const CMakeConfig config = configuration(k);
|
||||
|
||||
const bool isQt4 = version && version->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0);
|
||||
const bool isQt4 = version && version->qtVersion() < QVersionNumber(5, 0, 0);
|
||||
FilePath qmakePath; // This is relative to the cmake used for building.
|
||||
QStringList qtInstallDirs; // This is relativ to the cmake used for building.
|
||||
FilePath tcCPath;
|
||||
|
@@ -925,10 +925,10 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
|
||||
|
||||
m_runParameters.dumperPath = Core::ICore::resourcePath("debugger/");
|
||||
if (QtSupport::QtVersion *baseQtVersion = QtSupport::QtKitAspect::qtVersion(kit)) {
|
||||
QtSupport::QtVersionNumber qtVersion = baseQtVersion->qtVersion();
|
||||
m_runParameters.fallbackQtVersion = 0x10000 * int(qtVersion.majorVersion)
|
||||
+ 0x100 * int(qtVersion.minorVersion)
|
||||
+ int(qtVersion.patchVersion);
|
||||
const QVersionNumber qtVersion = baseQtVersion->qtVersion();
|
||||
m_runParameters.fallbackQtVersion = 0x10000 * qtVersion.majorVersion()
|
||||
+ 0x100 * qtVersion.minorVersion()
|
||||
+ qtVersion.microVersion();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -781,7 +781,7 @@ QmakeBuildConfigurationFactory::QmakeBuildConfigurationFactory()
|
||||
|
||||
addBuild(BuildConfiguration::Debug);
|
||||
addBuild(BuildConfiguration::Release);
|
||||
if (qtVersion && qtVersion->qtVersion().majorVersion > 4)
|
||||
if (qtVersion && qtVersion->qtVersion().majorVersion() > 4)
|
||||
addBuild(BuildConfiguration::Profile);
|
||||
|
||||
return result;
|
||||
|
@@ -120,7 +120,7 @@ QString QMakeStep::allArguments(const QtVersion *v, ArgumentFlags flags) const
|
||||
else
|
||||
arguments << project()->projectFilePath().toUserOutput();
|
||||
|
||||
if (v->qtVersion() < QtVersionNumber(5, 0, 0))
|
||||
if (v->qtVersion() < QVersionNumber(5, 0, 0))
|
||||
arguments << "-r";
|
||||
bool userProvidedMkspec = false;
|
||||
for (ProcessArgs::ConstArgIterator ait(userArguments()); ait.next(); ) {
|
||||
@@ -194,7 +194,7 @@ bool QMakeStep::init()
|
||||
workingDirectory = qmakeBc->buildDirectory();
|
||||
|
||||
m_qmakeCommand = CommandLine{qtVersion->qmakeFilePath(), allArguments(qtVersion), CommandLine::Raw};
|
||||
m_runMakeQmake = (qtVersion->qtVersion() >= QtVersionNumber(5, 0 ,0));
|
||||
m_runMakeQmake = (qtVersion->qtVersion() >= QVersionNumber(5, 0 ,0));
|
||||
|
||||
// The Makefile is used by qmake and make on the build device, from that
|
||||
// perspective it is local.
|
||||
@@ -427,7 +427,7 @@ QString QMakeStep::effectiveQMakeCall() const
|
||||
QmakeBuildConfiguration *qmakeBc = qmakeBuildConfiguration();
|
||||
const FilePath makefile = qmakeBc ? qmakeBc->makefile() : FilePath();
|
||||
result += ' ' + allArguments(qtVersion, ArgumentFlag::Expand);
|
||||
if (qtVersion->qtVersion() >= QtVersionNumber(5, 0, 0))
|
||||
if (qtVersion->qtVersion() >= QVersionNumber(5, 0, 0))
|
||||
result.append(QString(" && %1 %2").arg(make.path()).arg(makeArguments(makefile.path())));
|
||||
}
|
||||
return result;
|
||||
|
@@ -36,7 +36,7 @@ void MeshImageCacheCollector::start(Utils::SmallStringView name,
|
||||
QString qtQuickVersion;
|
||||
QString qtQuick3DVersion;
|
||||
QtSupport::QtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(target()->kit());
|
||||
if (qtVersion && qtVersion->qtVersion() < QtSupport::QtVersionNumber(6, 0, 0)) {
|
||||
if (qtVersion && qtVersion->qtVersion() < QVersionNumber(6, 0, 0)) {
|
||||
qtQuickVersion = "2.15";
|
||||
qtQuick3DVersion = "1.15";
|
||||
}
|
||||
|
@@ -666,9 +666,9 @@ bool PuppetCreator::checkPuppetIsReady(const QString &puppetPath) const
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool nonEarlyQt5Version(const QtSupport::QtVersionNumber ¤tQtVersionNumber)
|
||||
static bool nonEarlyQt5Version(const QVersionNumber ¤tQtVersionNumber)
|
||||
{
|
||||
return currentQtVersionNumber >= QtSupport::QtVersionNumber(5, 2, 0) || currentQtVersionNumber < QtSupport::QtVersionNumber(5, 0, 0);
|
||||
return currentQtVersionNumber >= QVersionNumber(5, 2, 0) || currentQtVersionNumber < QVersionNumber(5, 0, 0);
|
||||
}
|
||||
|
||||
bool PuppetCreator::qtIsSupported() const
|
||||
|
@@ -2250,7 +2250,7 @@ void TextToModelMerger::collectImportErrors(QList<DocumentMessage> *errors)
|
||||
if (currentQtVersion && currentQtVersion->isValid()) {
|
||||
const bool qt6import = import.version().startsWith("6");
|
||||
|
||||
if (currentQtVersion->qtVersion().majorVersion == 5
|
||||
if (currentQtVersion->qtVersion().majorVersion() == 5
|
||||
&& (m_hasVersionlessImport || qt6import)) {
|
||||
const QmlJS::DiagnosticMessage diagnosticMessage(
|
||||
QmlJS::Severity::Error,
|
||||
|
@@ -184,7 +184,7 @@ static QUrl localServerUrl(RunControl *runControl)
|
||||
Kit *kit = runControl->kit();
|
||||
const QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit);
|
||||
if (version) {
|
||||
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0))
|
||||
if (version->qtVersion() >= QVersionNumber(5, 6, 0))
|
||||
serverUrl = Utils::urlFromLocalSocket();
|
||||
else
|
||||
serverUrl = Utils::urlFromLocalHostAndFreePort();
|
||||
|
@@ -532,7 +532,7 @@ Tasks QmlProject::projectIssues(const Kit *k) const
|
||||
if (dev.isNull())
|
||||
result.append(createProjectTask(Task::TaskType::Error, tr("Kit has no device.")));
|
||||
|
||||
if (version && version->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0))
|
||||
if (version && version->qtVersion() < QVersionNumber(5, 0, 0))
|
||||
result.append(createProjectTask(Task::TaskType::Error, tr("Qt version is too old.")));
|
||||
|
||||
if (dev.isNull() || !version)
|
||||
@@ -593,7 +593,7 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
|
||||
if (k->isReplacementKit())
|
||||
return false;
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
||||
return (version && version->qtVersion().majorVersion == qtMajorVersion);
|
||||
return (version && version->qtVersion().majorVersion() == qtMajorVersion);
|
||||
});
|
||||
if (!qtVersionkits.isEmpty()) {
|
||||
if (qtVersionkits.contains(KitManager::defaultKit()))
|
||||
|
@@ -245,7 +245,7 @@ void QmlProjectRunConfiguration::createQtVersionAspect()
|
||||
m_qtversionAspect->addOption(tr("Qt 5"));
|
||||
m_qtversionAspect->addOption(tr("Qt 6"));
|
||||
|
||||
const int valueForVersion = version->qtVersion().majorVersion == 6 ? 1 : 0;
|
||||
const int valueForVersion = version->qtVersion().majorVersion() == 6 ? 1 : 0;
|
||||
|
||||
m_qtversionAspect->setValue(valueForVersion);
|
||||
|
||||
@@ -260,7 +260,7 @@ void QmlProjectRunConfiguration::createQtVersionAspect()
|
||||
|
||||
const QList<Kit *> kits = Utils::filtered(KitManager::kits(), [&](const Kit *k) {
|
||||
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
||||
return (version && version->qtVersion().majorVersion == preferedQtVersion)
|
||||
return (version && version->qtVersion().majorVersion() == preferedQtVersion)
|
||||
&& DeviceTypeKitAspect::deviceTypeId(k)
|
||||
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
});
|
||||
|
@@ -144,6 +144,12 @@ static QSet<Id> versionedIds(const QByteArray &prefix, int major, int minor)
|
||||
return result;
|
||||
}
|
||||
|
||||
static QSet<Id> versionedIds(const QVersionNumber &version)
|
||||
{
|
||||
return versionedIds(Constants::FEATURE_QT_PREFIX,
|
||||
version.majorVersion(), version.minorVersion());
|
||||
}
|
||||
|
||||
// Wrapper to make the std::unique_ptr<Utils::MacroExpander> "copyable":
|
||||
class MacroExpanderWrapper
|
||||
{
|
||||
@@ -242,78 +248,6 @@ MacroExpander *MacroExpanderWrapper::macroExpander(const QtVersion *qtversion) c
|
||||
|
||||
} // Internal
|
||||
|
||||
///////////////
|
||||
// QtVersionNumber
|
||||
///////////////
|
||||
QtVersionNumber::QtVersionNumber(int ma, int mi, int p)
|
||||
: majorVersion(ma), minorVersion(mi), patchVersion(p)
|
||||
{ }
|
||||
|
||||
QtVersionNumber::QtVersionNumber(const QString &versionString)
|
||||
{
|
||||
if (::sscanf(versionString.toLatin1().constData(), "%d.%d.%d",
|
||||
&majorVersion, &minorVersion, &patchVersion) != 3)
|
||||
majorVersion = minorVersion = patchVersion = -1;
|
||||
}
|
||||
|
||||
QSet<Id> QtVersionNumber::features() const
|
||||
{
|
||||
return versionedIds(Constants::FEATURE_QT_PREFIX, majorVersion, minorVersion);
|
||||
}
|
||||
|
||||
bool QtVersionNumber::matches(int major, int minor, int patch) const
|
||||
{
|
||||
if (major < 0)
|
||||
return true;
|
||||
if (major != majorVersion)
|
||||
return false;
|
||||
|
||||
if (minor < 0)
|
||||
return true;
|
||||
if (minor != minorVersion)
|
||||
return false;
|
||||
|
||||
if (patch < 0)
|
||||
return true;
|
||||
return (patch == patchVersion);
|
||||
}
|
||||
|
||||
bool QtVersionNumber::operator <(const QtVersionNumber &b) const
|
||||
{
|
||||
if (majorVersion != b.majorVersion)
|
||||
return majorVersion < b.majorVersion;
|
||||
if (minorVersion != b.minorVersion)
|
||||
return minorVersion < b.minorVersion;
|
||||
return patchVersion < b.patchVersion;
|
||||
}
|
||||
|
||||
bool QtVersionNumber::operator >(const QtVersionNumber &b) const
|
||||
{
|
||||
return b < *this;
|
||||
}
|
||||
|
||||
bool QtVersionNumber::operator ==(const QtVersionNumber &b) const
|
||||
{
|
||||
return majorVersion == b.majorVersion
|
||||
&& minorVersion == b.minorVersion
|
||||
&& patchVersion == b.patchVersion;
|
||||
}
|
||||
|
||||
bool QtVersionNumber::operator !=(const QtVersionNumber &b) const
|
||||
{
|
||||
return !(*this == b);
|
||||
}
|
||||
|
||||
bool QtVersionNumber::operator <=(const QtVersionNumber &b) const
|
||||
{
|
||||
return !(*this > b);
|
||||
}
|
||||
|
||||
bool QtVersionNumber::operator >=(const QtVersionNumber &b) const
|
||||
{
|
||||
return b <= *this;
|
||||
}
|
||||
|
||||
///////////////
|
||||
// QtVersion
|
||||
///////////////
|
||||
@@ -358,46 +292,46 @@ QString QtVersion::defaultUnexpandedDisplayName() const
|
||||
|
||||
QSet<Id> QtVersion::availableFeatures() const
|
||||
{
|
||||
QSet<Id> features = qtVersion().features(); // Qt Version features
|
||||
QSet<Id> features = versionedIds(qtVersion()); // Qt Version features
|
||||
|
||||
features.insert(Constants::FEATURE_QWIDGETS);
|
||||
features.insert(Constants::FEATURE_QT_WEBKIT);
|
||||
features.insert(Constants::FEATURE_QT_CONSOLE);
|
||||
|
||||
if (qtVersion() < QtVersionNumber(4, 7, 0))
|
||||
if (qtVersion() < QVersionNumber(4, 7, 0))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 1, 0));
|
||||
|
||||
if (qtVersion().matches(4, 7, 0))
|
||||
if (qtVersion() == QVersionNumber(4, 7, 0))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 1, 1));
|
||||
|
||||
if (qtVersion().matches(4))
|
||||
if (QVersionNumber(4).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 0));
|
||||
|
||||
if (qtVersion().matches(5, 0))
|
||||
if (QVersionNumber(5, 0).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 1));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_PREFIX, 1, 0));
|
||||
|
||||
if (qtVersion().matches(5, 1))
|
||||
if (QVersionNumber(5, 1).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 2));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_PREFIX, 1, 1));
|
||||
|
||||
if (qtVersion().matches(5, 2))
|
||||
if (QVersionNumber(5, 2).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 3));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_PREFIX, 1, 2));
|
||||
|
||||
if (qtVersion().matches(5, 3))
|
||||
if (QVersionNumber(5, 3).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.insert(Constants::FEATURE_QT_QUICK_UI_FILES);
|
||||
@@ -405,7 +339,7 @@ QSet<Id> QtVersion::availableFeatures() const
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 4));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_PREFIX, 1, 3));
|
||||
|
||||
if (qtVersion().matches(5, 4))
|
||||
if (QVersionNumber(5, 4).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.insert(Constants::FEATURE_QT_3D);
|
||||
@@ -414,7 +348,7 @@ QSet<Id> QtVersion::availableFeatures() const
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_PREFIX, 1, 4));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_CANVAS3D_PREFIX, 1, 0));
|
||||
|
||||
if (qtVersion().matches(5, 5))
|
||||
if (QVersionNumber(5, 5).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 6));
|
||||
@@ -422,62 +356,62 @@ QSet<Id> QtVersion::availableFeatures() const
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_LABS_CONTROLS_PREFIX, 1, 0));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_CANVAS3D_PREFIX, 1, 1));
|
||||
|
||||
if (qtVersion().matches(5, 6))
|
||||
if (QVersionNumber(5, 6).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 7));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 0));
|
||||
features.subtract(versionedIds(Constants::FEATURE_QT_LABS_CONTROLS_PREFIX, 1, 0));
|
||||
|
||||
if (qtVersion().matches(5, 7))
|
||||
if (QVersionNumber(5, 7).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 8));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 1));
|
||||
|
||||
if (qtVersion().matches(5, 8))
|
||||
if (QVersionNumber(5, 8).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 9));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 2));
|
||||
|
||||
if (qtVersion().matches(5, 9))
|
||||
if (QVersionNumber(5, 9).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 10));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 3));
|
||||
|
||||
if (qtVersion().matches(5, 10))
|
||||
if (QVersionNumber(5, 10).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 11));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 4));
|
||||
|
||||
if (qtVersion().matches(5, 11))
|
||||
if (QVersionNumber(5, 11).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 12));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 5));
|
||||
|
||||
if (qtVersion().matches(5, 12))
|
||||
if (QVersionNumber(5, 12).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 13));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 13));
|
||||
|
||||
if (qtVersion().matches(5, 13))
|
||||
if (QVersionNumber(5, 13).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 14));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 14));
|
||||
|
||||
if (qtVersion().matches(5, 14))
|
||||
if (QVersionNumber(5, 14).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 15));
|
||||
features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 15));
|
||||
|
||||
if (qtVersion().matches(5, 15))
|
||||
if (QVersionNumber(5, 15).isPrefixOf(qtVersion()))
|
||||
return features;
|
||||
|
||||
// Qt 6 uses versionless imports
|
||||
@@ -1026,7 +960,7 @@ FilePath QtVersion::qmlRuntimeFilePath() const
|
||||
return d->m_qmlRuntimePath;
|
||||
|
||||
FilePath path = binPath();
|
||||
if (qtVersion() >= QtVersionNumber(6, 2, 0))
|
||||
if (qtVersion() >= QVersionNumber(6, 2, 0))
|
||||
path = path.pathAppended("qml").withExecutableSuffix();
|
||||
else
|
||||
path = path.pathAppended("qmlscene").withExecutableSuffix();
|
||||
@@ -1053,7 +987,7 @@ FilePath QtVersion::qmlplugindumpFilePath() const
|
||||
FilePath QtVersionPrivate::findHostBinary(HostBinaries binary) const
|
||||
{
|
||||
FilePath baseDir;
|
||||
if (q->qtVersion() < QtVersionNumber(5, 0, 0)) {
|
||||
if (q->qtVersion() < QVersionNumber(5, 0, 0)) {
|
||||
baseDir = q->binPath();
|
||||
} else {
|
||||
switch (binary) {
|
||||
@@ -1064,7 +998,7 @@ FilePath QtVersionPrivate::findHostBinary(HostBinaries binary) const
|
||||
break;
|
||||
case Rcc:
|
||||
case Uic:
|
||||
if (q->qtVersion() >= QtVersionNumber(6, 1))
|
||||
if (q->qtVersion() >= QVersionNumber(6, 1))
|
||||
baseDir = q->hostLibexecPath();
|
||||
else
|
||||
baseDir = q->hostBinPath();
|
||||
@@ -1096,7 +1030,7 @@ FilePath QtVersionPrivate::findHostBinary(HostBinaries binary) const
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
possibleCommands << "rcc.exe";
|
||||
} else {
|
||||
const QString majorString = QString::number(q->qtVersion().majorVersion);
|
||||
const QString majorString = QString::number(q->qtVersion().majorVersion());
|
||||
possibleCommands << ("rcc-qt" + majorString) << ("rcc" + majorString) << "rcc";
|
||||
}
|
||||
break;
|
||||
@@ -1104,7 +1038,7 @@ FilePath QtVersionPrivate::findHostBinary(HostBinaries binary) const
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
possibleCommands << "uic.exe";
|
||||
} else {
|
||||
const QString majorString = QString::number(q->qtVersion().majorVersion);
|
||||
const QString majorString = QString::number(q->qtVersion().majorVersion());
|
||||
possibleCommands << ("uic-qt" + majorString) << ("uic" + majorString) << "uic";
|
||||
}
|
||||
break;
|
||||
@@ -1287,9 +1221,9 @@ QString QtVersion::qtVersionString() const
|
||||
return d->m_data.qtVersionString;
|
||||
}
|
||||
|
||||
QtVersionNumber QtVersion::qtVersion() const
|
||||
QVersionNumber QtVersion::qtVersion() const
|
||||
{
|
||||
return QtVersionNumber(qtVersionString());
|
||||
return QVersionNumber::fromString(qtVersionString());
|
||||
}
|
||||
|
||||
void QtVersionPrivate::updateVersionInfo()
|
||||
@@ -1687,7 +1621,7 @@ void QtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Target
|
||||
QSet<Id> QtVersion::features() const
|
||||
{
|
||||
if (d->m_overrideFeatures.isEmpty())
|
||||
return availableFeatures();
|
||||
return versionedIds(qtVersion());
|
||||
return d->m_overrideFeatures;
|
||||
}
|
||||
|
||||
@@ -1717,8 +1651,8 @@ void QtVersion::setupQmakeRunEnvironment(Environment &env) const
|
||||
|
||||
bool QtVersion::hasQmlDumpWithRelocatableFlag() const
|
||||
{
|
||||
return ((qtVersion() > QtVersionNumber(4, 8, 4) && qtVersion() < QtVersionNumber(5, 0, 0))
|
||||
|| qtVersion() >= QtVersionNumber(5, 1, 0));
|
||||
return ((qtVersion() > QVersionNumber(4, 8, 4) && qtVersion() < QVersionNumber(5, 0, 0))
|
||||
|| qtVersion() >= QVersionNumber(5, 1, 0));
|
||||
}
|
||||
|
||||
Tasks QtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDir) const
|
||||
@@ -2019,7 +1953,7 @@ bool QtVersion::isQmlDebuggingSupported(QString *reason) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (qtVersion() < QtVersionNumber(5, 0, 0)) {
|
||||
if (qtVersion() < QVersionNumber(5, 0, 0)) {
|
||||
if (reason)
|
||||
*reason = Tr::tr("Requires Qt 5.0.0 or newer.");
|
||||
return false;
|
||||
@@ -2048,7 +1982,7 @@ bool QtVersion::isQtQuickCompilerSupported(QString *reason) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (qtVersion() < QtVersionNumber(5, 3, 0)) {
|
||||
if (qtVersion() < QVersionNumber(5, 3, 0)) {
|
||||
if (reason)
|
||||
*reason = Tr::tr("Requires Qt 5.3.0 or newer.");
|
||||
return false;
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "qtsupport_global.h"
|
||||
#include "qversionnumber.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/macroexpander.h>
|
||||
@@ -36,28 +37,6 @@ namespace QtSupport {
|
||||
class QtConfigWidget;
|
||||
class QtVersion;
|
||||
|
||||
class QTSUPPORT_EXPORT QtVersionNumber
|
||||
{
|
||||
public:
|
||||
QtVersionNumber(int ma = -1, int mi = -1, int p = -1);
|
||||
QtVersionNumber(const QString &versionString);
|
||||
|
||||
QSet<Utils::Id> features() const;
|
||||
|
||||
int majorVersion;
|
||||
int minorVersion;
|
||||
int patchVersion;
|
||||
|
||||
bool matches(int major = -1, int minor = -1, int patch = -1) const;
|
||||
|
||||
bool operator <(const QtVersionNumber &b) const;
|
||||
bool operator <=(const QtVersionNumber &b) const;
|
||||
bool operator >(const QtVersionNumber &b) const;
|
||||
bool operator >=(const QtVersionNumber &b) const;
|
||||
bool operator !=(const QtVersionNumber &b) const;
|
||||
bool operator ==(const QtVersionNumber &b) const;
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
class QtOptionsPageWidget;
|
||||
class QtVersionPrivate;
|
||||
@@ -118,7 +97,7 @@ public:
|
||||
Utils::FilePath qmlplugindumpFilePath() const;
|
||||
|
||||
QString qtVersionString() const;
|
||||
QtVersionNumber qtVersion() const;
|
||||
QVersionNumber qtVersion() const;
|
||||
|
||||
QStringList qtSoPaths() const;
|
||||
|
||||
|
@@ -12,9 +12,9 @@ CppKitInfo::CppKitInfo(ProjectExplorer::Kit *kit)
|
||||
: ProjectExplorer::KitInfo(kit)
|
||||
{
|
||||
if (kit && (qtVersion = QtKitAspect::qtVersion(kit))) {
|
||||
if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0))
|
||||
if (qtVersion->qtVersion() < QVersionNumber(5, 0, 0))
|
||||
projectPartQtVersion = Utils::QtMajorVersion::Qt4;
|
||||
else if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(6, 0, 0))
|
||||
else if (qtVersion->qtVersion() < QVersionNumber(6, 0, 0))
|
||||
projectPartQtVersion = Utils::QtMajorVersion::Qt5;
|
||||
else
|
||||
projectPartQtVersion = Utils::QtMajorVersion::Qt6;
|
||||
|
@@ -395,17 +395,17 @@ Kit::Predicate QtKitAspect::platformPredicate(Id platform)
|
||||
}
|
||||
|
||||
Kit::Predicate QtKitAspect::qtVersionPredicate(const QSet<Id> &required,
|
||||
const QtVersionNumber &min,
|
||||
const QtVersionNumber &max)
|
||||
const QVersionNumber &min,
|
||||
const QVersionNumber &max)
|
||||
{
|
||||
return [required, min, max](const Kit *kit) -> bool {
|
||||
QtVersion *version = QtKitAspect::qtVersion(kit);
|
||||
if (!version)
|
||||
return false;
|
||||
QtVersionNumber current = version->qtVersion();
|
||||
if (min.majorVersion > -1 && current < min)
|
||||
const QVersionNumber current = version->qtVersion();
|
||||
if (min.majorVersion() > -1 && current < min)
|
||||
return false;
|
||||
if (max.majorVersion > -1 && current > max)
|
||||
if (max.majorVersion() > -1 && current > max)
|
||||
return false;
|
||||
return version->features().contains(required);
|
||||
};
|
||||
|
@@ -46,8 +46,8 @@ public:
|
||||
static ProjectExplorer::Kit::Predicate platformPredicate(Utils::Id availablePlatforms);
|
||||
static ProjectExplorer::Kit::Predicate
|
||||
qtVersionPredicate(const QSet<Utils::Id> &required = QSet<Utils::Id>(),
|
||||
const QtVersionNumber &min = QtVersionNumber(0, 0, 0),
|
||||
const QtVersionNumber &max = QtVersionNumber(INT_MAX, INT_MAX, INT_MAX));
|
||||
const QVersionNumber &min = QVersionNumber(0, 0, 0),
|
||||
const QVersionNumber &max = QVersionNumber(INT_MAX, INT_MAX, INT_MAX));
|
||||
|
||||
QSet<Utils::Id> supportedPlatforms(const ProjectExplorer::Kit *k) const override;
|
||||
QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const override;
|
||||
|
@@ -253,7 +253,7 @@ void TestQtProjectImporter::deleteDirectoryData(void *directoryData) const
|
||||
static QStringList additionalFilesToCopy(const QtVersion *qt)
|
||||
{
|
||||
// This is a hack and only works with local, "standard" installations of Qt
|
||||
const int major = qt->qtVersion().majorVersion;
|
||||
const int major = qt->qtVersion().majorVersion();
|
||||
if (major >= 6) {
|
||||
if (HostOsInfo::isMacHost()) {
|
||||
return {"lib/QtCore.framework/Versions/A/QtCore"};
|
||||
|
@@ -487,7 +487,7 @@ static QStringList documentationFiles(const QtVersions &vs, bool highestOnly = f
|
||||
QSet<QString> filePaths;
|
||||
const QtVersions versions = highestOnly ? QtVersionManager::sortVersions(vs) : vs;
|
||||
for (QtVersion *v : versions) {
|
||||
const int majorVersion = v->qtVersion().majorVersion;
|
||||
const int majorVersion = v->qtVersion().majorVersion();
|
||||
QSet<QString> &majorVersionFileNames = includedFileNames[majorVersion];
|
||||
for (const std::pair<Path, FileName> &file : documentationFiles(v)) {
|
||||
if (!highestOnly || !majorVersionFileNames.contains(file.second)) {
|
||||
|
@@ -36,7 +36,7 @@ public:
|
||||
QStringList DesktopQtVersion::warningReason() const
|
||||
{
|
||||
QStringList ret = QtVersion::warningReason();
|
||||
if (qtVersion() >= QtVersionNumber(5, 0, 0)) {
|
||||
if (qtVersion() >= QVersionNumber(5, 0, 0)) {
|
||||
if (qmlRuntimeFilePath().isEmpty())
|
||||
ret << Tr::tr("No QML utility installed.");
|
||||
}
|
||||
|
@@ -92,9 +92,8 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget()
|
||||
mainLayout->addStretch();
|
||||
|
||||
{
|
||||
const QString minimumSupportedQtVersion = QString::fromLatin1("%1.%2")
|
||||
.arg(WebAssemblyQtVersion::minimumSupportedQtVersion().majorVersion)
|
||||
.arg(WebAssemblyQtVersion::minimumSupportedQtVersion().minorVersion);
|
||||
const QString minimumSupportedQtVersion =
|
||||
WebAssemblyQtVersion::minimumSupportedQtVersion().toString();
|
||||
m_qtVersionDisplay = new InfoLabel(
|
||||
tr("Note: %1 supports Qt %2 for WebAssembly and higher. "
|
||||
"Your installed lower version(s) are not supported.")
|
||||
|
@@ -61,13 +61,12 @@ QString WebAssemblyQtVersion::invalidReason() const
|
||||
|
||||
return tr("%1 does not support Qt for WebAssembly below version %2.")
|
||||
.arg(Core::ICore::versionString())
|
||||
.arg(QVersionNumber(minimumSupportedQtVersion().majorVersion,
|
||||
minimumSupportedQtVersion().minorVersion).toString());
|
||||
.arg(minimumSupportedQtVersion().toString());
|
||||
}
|
||||
|
||||
const QtVersionNumber &WebAssemblyQtVersion::minimumSupportedQtVersion()
|
||||
const QVersionNumber &WebAssemblyQtVersion::minimumSupportedQtVersion()
|
||||
{
|
||||
const static QtVersionNumber number(5, 15);
|
||||
const static QVersionNumber number(5, 15);
|
||||
return number;
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
bool isValid() const override;
|
||||
QString invalidReason() const override;
|
||||
|
||||
static const QtSupport::QtVersionNumber &minimumSupportedQtVersion();
|
||||
static const QVersionNumber &minimumSupportedQtVersion();
|
||||
static bool isQtVersionInstalled();
|
||||
static bool isUnsupportedQtVersionInstalled();
|
||||
};
|
||||
|
Reference in New Issue
Block a user