forked from qt-creator/qt-creator
QtSupport: Add support to register Qt versions via qtpaths
qmake is a "build tool", and it is also a "query tool" when called with parameter "-query". Qt Creator, so far, assumes that building and querying with a Qt installation are done with one and the same tool: qmake. This change adds the ability to register a Qt version vie either qmake or qtpaths and still build with qmake, if that is installed (which is not anymore mandatory from Qt 6 on). 1) Distinguish between Qt query tool and qmake build tool: Add QtVersion::queryToolFilePath() to the existing QtVersion::qmakeFilePath(), and use queryToolFilePath in most "query" related code, and qmakeFilePath when building with qmake (e.g. in QmakeProjectManager). Also, a couple of functions and variables were renamed from *qmake* to *queryTool* in order to express that the affected code is about querying/managing Qt versions rather than about building with qmake. 2) Support manual Qt Version adding by qtpaths via file dialog This change adds qtpaths to the "Add" Qt Version file picker filter. After selection, "qtpaths -query" is executed for testing purposes. If that fails, (e.g. because it is an older Qt version), qmake is instead chosen, silently. Task-number: QTCREATORBUG-22175 Task-number: QTCREATORBUG-25546 Change-Id: I4d9c1e7eec7d5ae7c5a8d2e1a1ed95addff69966 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -214,10 +214,10 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const
|
||||
QString error;
|
||||
|
||||
const auto handleQmake = [this, &qtVersions, &error](const FilePath &qmake) {
|
||||
if (QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQMakePath(qmake,
|
||||
false,
|
||||
m_sharedId,
|
||||
&error)) {
|
||||
if (QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQueryToolPath(qmake,
|
||||
false,
|
||||
m_sharedId,
|
||||
&error)) {
|
||||
if (qtVersion->isValid()) {
|
||||
if (!Utils::anyOf(qtVersions,
|
||||
[qtVersion](QtVersion* other) {
|
||||
@@ -227,7 +227,7 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const
|
||||
qtVersions.append(qtVersion);
|
||||
QtVersionManager::addVersion(qtVersion);
|
||||
emit q->logOutput(
|
||||
tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput()));
|
||||
tr("Found \"%1\"").arg(qtVersion->queryToolFilePath().toUserOutput()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user