");
} else {
// Deduce a description from '/foo/qt-folder/[qtbase]/bin/qmake' -> '/foo/qt-folder'.
// '/usr' indicates System Qt 4.X on Linux.
- for (FilePath dir = queryToolFilePath().parentDir(); !dir.isEmpty(); dir = dir.parentDir()) {
+ for (FilePath dir = qmakeFilePath().parentDir(); !dir.isEmpty(); dir = dir.parentDir()) {
const QString dirName = dir.fileName();
if (dirName == "usr") { // System-installed Qt.
location = QCoreApplication::translate("QtVersion", "System");
@@ -727,23 +725,20 @@ void QtVersion::fromMap(const QVariantMap &map)
d->m_isAutodetected = map.value(QTVERSIONAUTODETECTED).toBool();
d->m_detectionSource = map.value(QTVERSIONDETECTIONSOURCE).toString();
d->m_overrideFeatures = Utils::Id::fromStringList(map.value(QTVERSION_OVERRIDE_FEATURES).toStringList());
- d->m_queryTool = FilePath::fromVariant(map.value(QTVERSIONQUERYTOOLPATH,
- map.value(QTVERSIONQMAKEPATH)));
- if (!d->m_queryTool.baseName().contains("qtpaths"))
- d->m_qmakeCommand = d->m_queryTool;
+ d->m_qmakeCommand = FilePath::fromVariant(map.value(QTVERSIONQMAKEPATH));
- FilePath queryTool = d->m_queryTool;
+ FilePath qmake = d->m_qmakeCommand;
// FIXME: Check this is still needed or whether ProcessArgs::splitArg handles it.
- QString string = d->m_queryTool.path();
+ QString string = d->m_qmakeCommand.path();
if (string.startsWith('~'))
string.remove(0, 1).prepend(QDir::homePath());
- queryTool.setPath(string);
- if (!d->m_queryTool.needsDevice()) {
- if (BuildableHelperLibrary::isQtChooser(queryTool)) {
+ qmake.setPath(string);
+ if (!d->m_qmakeCommand.needsDevice()) {
+ if (BuildableHelperLibrary::isQtChooser(qmake)) {
// we don't want to treat qtchooser as a normal qmake
// see e.g. QTCREATORBUG-9841, also this lead to users changing what
// qtchooser forwards too behind our backs, which will inadvertly lead to bugs
- d->m_queryTool = BuildableHelperLibrary::qtChooserToQueryToolPath(queryTool);
+ d->m_qmakeCommand = BuildableHelperLibrary::qtChooserToQmakePath(qmake);
}
}
@@ -774,7 +769,6 @@ QVariantMap QtVersion::toMap() const
result.insert(QTVERSION_OVERRIDE_FEATURES, Utils::Id::toStringList(d->m_overrideFeatures));
result.insert(QTVERSIONQMAKEPATH, qmakeFilePath().toVariant());
- result.insert(QTVERSIONQUERYTOOLPATH, queryToolFilePath().toVariant());
return result;
}
@@ -785,8 +779,8 @@ bool QtVersion::isValid() const
d->updateVersionInfo();
d->updateMkspec();
- return !queryToolFilePath().isEmpty() && d->m_data.installed && !binPath().isEmpty()
- && !d->m_mkspecFullPath.isEmpty() && d->m_queryToolIsExecutable;
+ return !qmakeFilePath().isEmpty() && d->m_data.installed && !binPath().isEmpty()
+ && !d->m_mkspecFullPath.isEmpty() && d->m_qmakeIsExecutable;
}
QtVersion::Predicate QtVersion::isValidPredicate(const QtVersion::Predicate &predicate)
@@ -800,18 +794,15 @@ QString QtVersion::invalidReason() const
{
if (displayName().isEmpty())
return QCoreApplication::translate("QtVersion", "Qt version has no name");
- if (queryToolFilePath().isEmpty())
- return QCoreApplication::translate("QtVersion", "No Qt query tool path set");
- if (!d->m_queryToolIsExecutable)
- return QCoreApplication::translate("QtVersion", "%1 does not exist or is not executable")
- .arg(queryToolFilePath().baseName());
+ if (qmakeFilePath().isEmpty())
+ return QCoreApplication::translate("QtVersion", "No qmake path set");
+ if (!d->m_qmakeIsExecutable)
+ return QCoreApplication::translate("QtVersion", "qmake does not exist or is not executable");
if (!d->m_data.installed)
return QCoreApplication::translate("QtVersion", "Qt version is not properly installed, please run make install");
if (binPath().isEmpty())
return QCoreApplication::translate("QtVersion",
- "Could not determine the path to the binaries of the "
- "Qt installation, maybe the %1 path is wrong?")
- .arg(queryToolFilePath().baseName());
+ "Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?");
if (d->m_mkspecUpToDate && d->m_mkspecFullPath.isEmpty())
return QCoreApplication::translate("QtVersion", "The default mkspec symlink is broken.");
return QString();
@@ -829,20 +820,8 @@ QStringList QtVersion::warningReason() const
return ret;
}
-FilePath QtVersion::queryToolFilePath() const
-{
- return d->m_queryTool;
-}
-
FilePath QtVersion::qmakeFilePath() const
{
- if (d->m_qmakeCommand.isEmpty() && d->m_queryTool.baseName().contains("qtpaths")) {
- // TODO: might need a less lazy implementation
- const FilePath qmake =
- FilePath::fromString(d->m_queryTool.toString().replace("qtpaths", "qmake"));
- if (qmake.exists())
- d->m_qmakeCommand = qmake;
- }
return d->m_qmakeCommand;
}
@@ -876,7 +855,7 @@ bool QtVersion::hasAbi(ProjectExplorer::Abi::OS os, ProjectExplorer::Abi::OSFlav
bool QtVersion::equals(QtVersion *other)
{
- if (d->m_queryTool != other->d->m_queryTool)
+ if (d->m_qmakeCommand != other->d->m_qmakeCommand)
return false;
if (type() != other->type())
return false;
@@ -954,15 +933,13 @@ QString QtVersion::toHtml(bool verbose) const
str << "" << abis.at(i).toString() << " | ";
}
}
- const OsType osType = d->m_queryTool.osType();
+ const OsType osType = d->m_qmakeCommand.osType();
str << "" << QCoreApplication::translate("QtVersion", "Source:")
<< " | " << sourcePath().toUserOutput() << " |
";
str << "" << QCoreApplication::translate("QtVersion", "mkspec:")
<< " | " << QDir::toNativeSeparators(mkspec()) << " |
";
str << "" << QCoreApplication::translate("QtVersion", "qmake:")
- << " | " << qmakeFilePath().toUserOutput() << " |
";
- str << "" << QCoreApplication::translate("QtVersion", "Query tool:")
- << " | " << d->m_queryTool.toUserOutput() << " |
";
+ << "" << d->m_qmakeCommand.toUserOutput() << " | ";
ensureMkSpecParsed();
if (!mkspecPath().isEmpty()) {
if (d->m_defaultConfigIsDebug || d->m_defaultConfigIsDebugAndRelease) {
@@ -1187,13 +1164,13 @@ void QtVersionPrivate::updateMkspec()
return;
m_mkspecUpToDate = true;
- m_mkspecFullPath = mkspecFromVersionInfo(versionInfo(), m_queryTool);
+ m_mkspecFullPath = mkspecFromVersionInfo(versionInfo(), m_qmakeCommand);
m_mkspec = m_mkspecFullPath;
if (m_mkspecFullPath.isEmpty())
return;
- FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo(), m_queryTool);
+ FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo(), m_qmakeCommand);
if (m_mkspec.isChildOf(baseMkspecDir)) {
m_mkspec = m_mkspec.relativeChildPath(baseMkspecDir);
@@ -1220,7 +1197,7 @@ void QtVersion::ensureMkSpecParsed() const
QMakeVfs vfs;
QMakeGlobals option;
applyProperties(&option);
- Environment env = d->m_queryTool.deviceEnvironment();
+ Environment env = d->m_qmakeCommand.deviceEnvironment();
setupQmakeRunEnvironment(env);
option.environment = env.toProcessEnvironment();
ProMessageHandler msgHandler(true);
@@ -1333,7 +1310,7 @@ QtVersionNumber QtVersion::qtVersion() const
void QtVersionPrivate::updateVersionInfo()
{
- if (m_versionInfoUpToDate || !m_queryToolIsExecutable || m_isUpdating)
+ if (m_versionInfoUpToDate || !m_qmakeIsExecutable || m_isUpdating)
return;
m_isUpdating = true;
@@ -1344,16 +1321,16 @@ void QtVersionPrivate::updateVersionInfo()
m_data.hasExamples = false;
m_data.hasDocumentation = false;
- if (!queryQtPaths(m_queryTool, q->qmakeRunEnvironment(), &m_versionInfo)) {
- m_queryToolIsExecutable = false;
+ if (!queryQMakeVariables(m_qmakeCommand, q->qmakeRunEnvironment(), &m_versionInfo)) {
+ m_qmakeIsExecutable = false;
qWarning("Cannot update Qt version information: %s cannot be run.",
- qPrintable(m_queryTool.toString()));
+ qPrintable(m_qmakeCommand.toString()));
return;
}
- m_queryToolIsExecutable = true;
+ m_qmakeIsExecutable = true;
auto fileProperty = [this](const QByteArray &name) {
- return FilePath::fromUserInput(qmakeProperty(name)).onDevice(m_queryTool);
+ return FilePath::fromUserInput(qmakeProperty(name)).onDevice(m_qmakeCommand);
};
m_data.prefix = fileProperty("QT_INSTALL_PREFIX");
@@ -1408,8 +1385,8 @@ QHash QtVersionPrivate::versionInfo()
}
QString QtVersionPrivate::qmakeProperty(const QHash &versionInfo,
- const QByteArray &name,
- PropertyVariant variant)
+ const QByteArray &name,
+ PropertyVariant variant)
{
QString val = versionInfo
.value(ProKey(QString::fromLatin1(
@@ -1751,7 +1728,7 @@ void QtVersion::addToEnvironment(const Kit *k, Environment &env) const
Environment QtVersion::qmakeRunEnvironment() const
{
- Environment env = d->m_queryTool.deviceEnvironment();
+ Environment env = d->m_qmakeCommand.deviceEnvironment();
setupQmakeRunEnvironment(env);
return env;
}
@@ -1779,7 +1756,7 @@ Tasks QtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDi
results.append(BuildSystemTask(Task::Error, msg));
}
- FilePath qmake = queryToolFilePath();
+ FilePath qmake = qmakeFilePath();
if (!qmake.isExecutableFile()) {
//: %1: Path to qmake executable
const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion",
@@ -1839,21 +1816,20 @@ static QByteArray runQmakeQuery(const FilePath &binary, const Environment &env,
return process.readAllStandardOutput();
}
-bool QtVersionPrivate::queryQtPaths(const FilePath &queryTool, const Environment &env,
- QHash *versionInfo, QString *error)
+bool QtVersionPrivate::queryQMakeVariables(const FilePath &binary, const Environment &env,
+ QHash *versionInfo, QString *error)
{
QString tmp;
if (!error)
error = &tmp;
- if (!queryTool.isExecutableFile()) {
- *error = QCoreApplication::translate("QtVersion", "\"%1\" is not an executable.")
- .arg(queryTool.toUserOutput());
+ if (!binary.isExecutableFile()) {
+ *error = QCoreApplication::translate("QtVersion", "qmake \"%1\" is not an executable.").arg(binary.toUserOutput());
return false;
}
QByteArray output;
- output = runQmakeQuery(queryTool, env, error);
+ output = runQmakeQuery(binary, env, error);
if (!output.contains("QMAKE_VERSION:")) {
// Some setups pass error messages via stdout, fooling the logic below.
@@ -1871,14 +1847,14 @@ bool QtVersionPrivate::queryQtPaths(const FilePath &queryTool, const Environment
// Try running qmake with all kinds of tool chains set up in the environment.
// This is required to make non-static qmakes work on windows where every tool chain
// tries to be incompatible with any other.
- const Abis abiList = Abi::abisOfBinary(queryTool);
+ const Abis abiList = Abi::abisOfBinary(binary);
const Toolchains tcList = ToolChainManager::toolchains([&abiList](const ToolChain *t) {
return abiList.contains(t->targetAbi());
});
for (ToolChain *tc : tcList) {
Environment realEnv = env;
tc->addToEnvironment(realEnv);
- output = runQmakeQuery(queryTool, realEnv, error);
+ output = runQmakeQuery(binary, realEnv, error);
if (error->isEmpty())
break;
}
@@ -1900,18 +1876,18 @@ QString QtVersionPrivate::qmakeProperty(const QByteArray &name,
}
FilePath QtVersionPrivate::mkspecDirectoryFromVersionInfo(const QHash &versionInfo,
- const FilePath &queryTool)
+ const FilePath &qmakeCommand)
{
QString dataDir = qmakeProperty(versionInfo, "QT_HOST_DATA", PropertyVariantSrc);
if (dataDir.isEmpty())
return FilePath();
- return FilePath::fromUserInput(dataDir + "/mkspecs").onDevice(queryTool);
+ return FilePath::fromUserInput(dataDir + "/mkspecs").onDevice(qmakeCommand);
}
FilePath QtVersionPrivate::mkspecFromVersionInfo(const QHash &versionInfo,
- const FilePath &queryTool)
+ const FilePath &qmakeCommand)
{
- FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo, queryTool);
+ FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo, qmakeCommand);
if (baseMkspecDir.isEmpty())
return FilePath();
@@ -2343,16 +2319,14 @@ void QtVersion::resetCache() const
static QList g_qtVersionFactories;
-QtVersion *QtVersionFactory::createQtVersionFromQueryToolPath(const FilePath &queryTool,
- bool isAutoDetected,
- const QString &detectionSource,
- QString *error)
+QtVersion *QtVersionFactory::createQtVersionFromQMakePath
+ (const FilePath &qmakePath, bool isAutoDetected, const QString &detectionSource, QString *error)
{
QHash versionInfo;
- const Environment env = queryTool.deviceEnvironment();
- if (!QtVersionPrivate::queryQtPaths(queryTool, env, &versionInfo, error))
+ const Environment env = qmakePath.deviceEnvironment();
+ if (!QtVersionPrivate::queryQMakeVariables(qmakePath, env, &versionInfo, error))
return nullptr;
- FilePath mkspec = QtVersionPrivate::mkspecFromVersionInfo(versionInfo, queryTool);
+ FilePath mkspec = QtVersionPrivate::mkspecFromVersionInfo(versionInfo, qmakePath);
QMakeVfs vfs;
QMakeGlobals globals;
@@ -2368,7 +2342,7 @@ QtVersion *QtVersionFactory::createQtVersionFromQueryToolPath(const FilePath &qu
return l->m_priority > r->m_priority;
});
- if (!queryTool.isExecutableFile())
+ if (!qmakePath.isExecutableFile())
return nullptr;
QtVersionFactory::SetupData setup;
@@ -2381,8 +2355,8 @@ QtVersion *QtVersionFactory::createQtVersionFromQueryToolPath(const FilePath &qu
QtVersion *ver = factory->create();
QTC_ASSERT(ver, continue);
ver->d->m_id = QtVersionManager::getUniqueId();
- QTC_CHECK(ver->d->m_queryTool.isEmpty()); // Should only be used once.
- ver->d->m_queryTool = queryTool;
+ QTC_CHECK(ver->d->m_qmakeCommand.isEmpty()); // Should only be used once.
+ ver->d->m_qmakeCommand = qmakePath;
ver->d->m_detectionSource = detectionSource;
ver->d->m_isAutodetected = isAutoDetected;
ver->updateDefaultDisplayName();
@@ -2393,7 +2367,7 @@ QtVersion *QtVersionFactory::createQtVersionFromQueryToolPath(const FilePath &qu
ProFileCacheManager::instance()->decRefCount();
if (error) {
*error = QCoreApplication::translate("QtSupport::QtVersionFactory",
- "No factory found for query tool \"%1\"").arg(queryTool.toUserOutput());
+ "No factory found for qmake: \"%1\"").arg(qmakePath.toUserOutput());
}
return nullptr;
}
diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h
index f0400bc99b5..269a6507168 100644
--- a/src/plugins/qtsupport/baseqtversion.h
+++ b/src/plugins/qtsupport/baseqtversion.h
@@ -150,8 +150,6 @@ public:
bool hasDocs() const;
bool hasDemos() const;
- Utils::FilePath queryToolFilePath() const;
-
// former local functions
Utils::FilePath qmakeFilePath() const;
diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp
index 672ad493df4..43bbc07c1c3 100644
--- a/src/plugins/qtsupport/qtkitinformation.cpp
+++ b/src/plugins/qtsupport/qtkitinformation.cpp
@@ -324,11 +324,6 @@ void QtKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
QtVersion *version = qtVersion(kit);
return version ? version->qmakeFilePath().path() : QString();
});
- expander->registerVariable("Qt:queryToolExecutable", tr("Path to the query tool executable"),
- [kit]() -> QString {
- QtVersion *version = qtVersion(kit);
- return version ? version->queryToolFilePath().path() : QString();
- });
}
Id QtKitAspect::id()
diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp
index 06a8a6bbd52..c0049058abd 100644
--- a/src/plugins/qtsupport/qtoptionspage.cpp
+++ b/src/plugins/qtsupport/qtoptionspage.cpp
@@ -51,7 +51,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -112,7 +111,7 @@ public:
if (column == 0)
return m_version->displayName();
if (column == 1)
- return m_version->queryToolFilePath().toUserOutput();
+ return m_version->qmakeFilePath().toUserOutput();
}
if (role == Qt::FontRole && m_changed) {
@@ -129,8 +128,7 @@ public:
"%2";
return QString(""
+ row.arg(tr("Qt Version"), m_version->qtVersionString())
- + row.arg(tr("Location of the query tool"),
- m_version->queryToolFilePath().toUserOutput())
+ + row.arg(tr("Location of qmake"), m_version->qmakeFilePath().toUserOutput())
+ "
");
}
@@ -602,42 +600,27 @@ QtOptionsPageWidget::~QtOptionsPageWidget()
delete m_configurationWidget;
}
-static bool isIncompatibleQtPathsTool(const FilePath &tool)
-{
- if (!tool.baseName().startsWith("qtpaths"))
- return false;
- QtcProcess process;
- process.setTimeoutS(1);
- process.setCommand({tool, {"-query"}});
- process.runBlocking();
- return process.result() != ProcessResult::FinishedWithSuccess;
-}
-
void QtOptionsPageWidget::addQtDir()
{
- FilePath qtQueryTool =
- FileUtils::getOpenFilePath(this,
- tr("Select a qmake or qtpaths Executable"),
- {},
- BuildableHelperLibrary::filterForQtQueryToolsFileDialog(),
- 0,
- QFileDialog::DontResolveSymlinks);
- if (qtQueryTool.isEmpty())
+ FilePath qtVersion = FileUtils::getOpenFilePath(this,
+ tr("Select a qmake Executable"),
+ {},
+ BuildableHelperLibrary::filterForQmakeFileDialog(),
+ 0,
+ QFileDialog::DontResolveSymlinks);
+ if (qtVersion.isEmpty())
return;
- if (isIncompatibleQtPathsTool(qtQueryTool))
- qtQueryTool = qtQueryTool.parentDir() / HostOsInfo::withExecutableSuffix("qmake");
-
// should add all qt versions here ?
- if (BuildableHelperLibrary::isQtChooser(qtQueryTool))
- qtQueryTool = BuildableHelperLibrary::qtChooserToQueryToolPath(qtQueryTool.symLinkTarget());
+ if (BuildableHelperLibrary::isQtChooser(qtVersion))
+ qtVersion = BuildableHelperLibrary::qtChooserToQmakePath(qtVersion.symLinkTarget());
- auto checkAlreadyExists = [qtQueryTool](TreeItem *parent) {
+ auto checkAlreadyExists = [qtVersion](TreeItem *parent) {
for (int i = 0; i < parent->childCount(); ++i) {
auto item = static_cast(parent->childAt(i));
- // Compare parent dirs, since it could be either qmake or qtpaths
- if (item->version()->queryToolFilePath().parentDir() == qtQueryTool.parentDir())
+ if (item->version()->qmakeFilePath() == qtVersion) {
return std::make_pair(true, item->version()->displayName());
+ }
}
return std::make_pair(false, QString());
};
@@ -657,8 +640,7 @@ void QtOptionsPageWidget::addQtDir()
}
QString error;
- QtVersion *version = QtVersionFactory::createQtVersionFromQueryToolPath(qtQueryTool, false,
- QString(), &error);
+ QtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion, false, QString(), &error);
if (version) {
auto item = new QtVersionItem(version);
item->setIcon(version->isValid()? m_validVersionIcon : m_invalidVersionIcon);
@@ -668,9 +650,8 @@ void QtOptionsPageWidget::addQtDir()
m_versionUi.nameEdit->setFocus();
m_versionUi.nameEdit->selectAll();
} else {
- QMessageBox::warning(this, tr("Not Executable"),
- tr("The executable %1 could not be added: %2").arg(
- qtQueryTool.toUserOutput()).arg(error));
+ QMessageBox::warning(this, tr("Qmake Not Executable"),
+ tr("The qmake executable %1 could not be added: %2").arg(qtVersion.toUserOutput()).arg(error));
return;
}
updateCleanUpButton();
@@ -690,16 +671,16 @@ void QtOptionsPageWidget::removeQtDir()
void QtOptionsPageWidget::editPath()
{
QtVersion *current = currentVersion();
- const FilePath queryTool =
+ FilePath qtVersion =
FileUtils::getOpenFilePath(this,
- tr("Select a qmake or qtpaths Executable"),
- current->queryToolFilePath().absolutePath(),
- BuildableHelperLibrary::filterForQtQueryToolsFileDialog(),
+ tr("Select a qmake Executable"),
+ current->qmakeFilePath().absolutePath(),
+ BuildableHelperLibrary::filterForQmakeFileDialog(),
nullptr,
QFileDialog::DontResolveSymlinks);
- if (queryTool.isEmpty())
+ if (qtVersion.isEmpty())
return;
- QtVersion *version = QtVersionFactory::createQtVersionFromQueryToolPath(queryTool);
+ QtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion);
if (!version)
return;
// Same type? then replace!
@@ -787,7 +768,7 @@ void QtOptionsPageWidget::updateWidgets()
QtVersion *version = currentVersion();
if (version) {
m_versionUi.nameEdit->setText(version->unexpandedDisplayName());
- m_versionUi.queryToolPath->setText(version->queryToolFilePath().toUserOutput());
+ m_versionUi.qmakePath->setText(version->qmakeFilePath().toUserOutput());
m_configurationWidget = version->createConfigurationWidget();
if (m_configurationWidget) {
m_versionUi.formLayout->addRow(m_configurationWidget);
@@ -797,7 +778,7 @@ void QtOptionsPageWidget::updateWidgets()
}
} else {
m_versionUi.nameEdit->clear();
- m_versionUi.queryToolPath->clear();
+ m_versionUi.qmakePath->clear();
}
const bool enabled = version != nullptr;
diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp
index fc44f3b7d37..9014aa71f08 100644
--- a/src/plugins/qtsupport/qtprojectimporter.cpp
+++ b/src/plugins/qtsupport/qtprojectimporter.cpp
@@ -57,7 +57,7 @@ QtProjectImporter::QtVersionData
QtProjectImporter::findOrCreateQtVersion(const Utils::FilePath &qmakePath) const
{
QtVersionData result;
- result.qt = QtVersionManager::version(Utils::equal(&QtVersion::queryToolFilePath, qmakePath));
+ result.qt = QtVersionManager::version(Utils::equal(&QtVersion::qmakeFilePath, qmakePath));
if (result.qt) {
// Check if version is a temporary qt
const int qtId = result.qt->uniqueId();
@@ -67,7 +67,7 @@ QtProjectImporter::findOrCreateQtVersion(const Utils::FilePath &qmakePath) const
// Create a new version if not found:
// Do not use the canonical path here...
- result.qt = QtVersionFactory::createQtVersionFromQueryToolPath(qmakePath);
+ result.qt = QtVersionFactory::createQtVersionFromQMakePath(qmakePath);
result.isTemporary = true;
if (result.qt) {
UpdateGuard guard(*this);
@@ -281,7 +281,7 @@ static QStringList additionalFilesToCopy(const QtVersion *qt)
} else if (HostOsInfo::isWindowsHost()) {
const QString release = QString("bin/Qt%1Core.dll").arg(major);
const QString debug = QString("bin/Qt%1Cored.dll").arg(major);
- const FilePath base = qt->queryToolFilePath().parentDir().parentDir();
+ const FilePath base = qt->qmakeFilePath().parentDir().parentDir();
if (base.pathAppended(release).exists())
return {release};
if (base.pathAppended(debug).exists())
@@ -289,7 +289,7 @@ static QStringList additionalFilesToCopy(const QtVersion *qt)
return {release};
} else if (HostOsInfo::isLinuxHost()) {
const QString core = QString("lib/libQt%1Core.so.%1").arg(major);
- const QDir base(qt->queryToolFilePath().parentDir().parentDir().pathAppended("lib").toString());
+ const QDir base(qt->qmakeFilePath().parentDir().parentDir().pathAppended("lib").toString());
const QStringList icuLibs = Utils::transform(base.entryList({"libicu*.so.*"}), [](const QString &lib) { return QString("lib/" + lib); });
return QStringList(core) + icuLibs;
}
@@ -300,7 +300,7 @@ static QStringList additionalFilesToCopy(const QtVersion *qt)
static Utils::FilePath setupQmake(const QtVersion *qt, const QString &path)
{
// This is a hack and only works with local, "standard" installations of Qt
- const FilePath qmake = qt->queryToolFilePath().canonicalPath();
+ const FilePath qmake = qt->qmakeFilePath().canonicalPath();
const QString qmakeFile = "bin/" + qmake.fileName();
const FilePath source = qmake.parentDir().parentDir();
const FilePath target = FilePath::fromString(path);
diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h
index 96bf8e2088a..bc01ad7601a 100644
--- a/src/plugins/qtsupport/qtversionfactory.h
+++ b/src/plugins/qtsupport/qtversionfactory.h
@@ -51,7 +51,7 @@ public:
/// the desktop factory claims to handle all paths
int priority() const { return m_priority; }
- static QtVersion *createQtVersionFromQueryToolPath(const Utils::FilePath &qmakePath,
+ static QtVersion *createQtVersionFromQMakePath(const Utils::FilePath &qmakePath,
bool isAutoDetected = false,
const QString &detectionSource = {},
QString *error = nullptr);
diff --git a/src/plugins/qtsupport/qtversioninfo.ui b/src/plugins/qtsupport/qtversioninfo.ui
index 815be818177..467e898a20e 100644
--- a/src/plugins/qtsupport/qtversioninfo.ui
+++ b/src/plugins/qtsupport/qtversioninfo.ui
@@ -39,14 +39,14 @@
-
- Query tool path:
+ qmake path:
-
-
-
+
0
diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp
index c5f00e96189..2ca6c3a1237 100644
--- a/src/plugins/qtsupport/qtversionmanager.cpp
+++ b/src/plugins/qtsupport/qtversionmanager.cpp
@@ -265,8 +265,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
if (log().isDebugEnabled()) {
qCDebug(log) << "======= Existing Qt versions =======";
for (QtVersion *version : qAsConst(m_versions)) {
- qCDebug(log) << version->queryToolFilePath().toUserOutput()
- << "id:" <uniqueId();
+ qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:"<uniqueId();
qCDebug(log) << " autodetection source:" << version->detectionSource();
qCDebug(log) << "";
}
@@ -342,8 +341,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
if (log().isDebugEnabled()) {
qCDebug(log) << "======= Before removing outdated sdk versions =======";
for (QtVersion *version : qAsConst(m_versions)) {
- qCDebug(log) << version->queryToolFilePath().toUserOutput()
- << "id:" << version->uniqueId();
+ qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId();
qCDebug(log) << " autodetection source:" << version->detectionSource();
qCDebug(log) << "";
}
@@ -362,8 +360,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
if (log().isDebugEnabled()) {
qCDebug(log)<< "======= End result =======";
for (QtVersion *version : qAsConst(m_versions)) {
- qCDebug(log) << version->queryToolFilePath().toUserOutput()
- << "id:" << version->uniqueId();
+ qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId();
qCDebug(log) << " autodetection source:" << version->detectionSource();
qCDebug(log) << "";
}
@@ -404,20 +401,14 @@ static QList runQtChooser(const QString &qtchooser, const QStringLis
}
// Asks qtchooser for the qmake path of a given version
-// TODO: Extend to qtpaths if qtchooser is also used for Qt 6
static QString qmakePath(const QString &qtchooser, const QString &version)
{
const QList outputs = runQtChooser(qtchooser,
{QStringLiteral("-qt=%1").arg(version),
QStringLiteral("-print-env")});
- // Exemplary output of "qtchooser -qt=qt5-x86_64-linux-gnu -print-env":
- // QT_SELECT="qt5-x86_64-linux-gnu"
- // QTTOOLDIR="/usr/lib/qt5/bin"
- // QTLIBDIR="/usr/lib/x86_64-linux-gnu"
- const QByteArray qtToolDirPrefix("QTTOOLDIR=\"");
for (const QByteArray &output : outputs) {
- if (output.startsWith(qtToolDirPrefix)) {
- QByteArray withoutVarName = output.mid(qtToolDirPrefix.size()); // remove QTTOOLDIR="
+ if (output.startsWith("QTTOOLDIR=\"")) {
+ QByteArray withoutVarName = output.mid(11); // remove QTTOOLDIR="
withoutVarName.chop(1); // remove trailing quote
return QStandardPaths::findExecutable(QStringLiteral("qmake"), QStringList()
<< QString::fromLocal8Bit(withoutVarName));
@@ -433,15 +424,6 @@ static FilePaths gatherQmakePathsFromQtChooser()
return FilePaths();
const QList versions = runQtChooser(qtchooser, QStringList("-l"));
- // Exemplary output of "qtchooser -l":
- // 4
- // 5
- // default
- // qt4-x86_64-linux-gnu
- // qt4
- // qt5-x86_64-linux-gnu
- // qt5
- // ""
QSet foundQMakes;
for (const QByteArray &version : versions) {
FilePath possibleQMake = FilePath::fromString(
@@ -454,20 +436,19 @@ static FilePaths gatherQmakePathsFromQtChooser()
static void findSystemQt()
{
- FilePaths systemQueryTools
+ FilePaths systemQMakes
= BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment());
- systemQueryTools.append(gatherQmakePathsFromQtChooser());
- for (const FilePath &queryToolPath : qAsConst(systemQueryTools)) {
- if (BuildableHelperLibrary::isQtChooser(queryToolPath))
+ systemQMakes.append(gatherQmakePathsFromQtChooser());
+ for (const FilePath &qmakePath : qAsConst(systemQMakes)) {
+ if (BuildableHelperLibrary::isQtChooser(qmakePath))
continue;
- const auto isSameQueryTool = [queryToolPath](const QtVersion *version) {
+ const auto isSameQmake = [qmakePath](const QtVersion *version) {
return Environment::systemEnvironment().
- isSameExecutable(queryToolPath.toString(),
- version->queryToolFilePath().toString());
+ isSameExecutable(qmakePath.toString(), version->qmakeFilePath().toString());
};
- if (contains(m_versions, isSameQueryTool))
+ if (contains(m_versions, isSameQmake))
continue;
- QtVersion *version = QtVersionFactory::createQtVersionFromQueryToolPath(queryToolPath,
+ QtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath,
false,
"PATH");
if (version)