QtSupport: Add a method to retrieve the QML path

We check that qmake property in many different places.

Change-Id: Ifd5efe4ad2831385493bd3afe8538929578e8fb4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2017-09-27 16:10:13 +02:00
parent bb16ae7323
commit defcb6a55a
8 changed files with 16 additions and 6 deletions

View File

@@ -138,7 +138,7 @@ void AndroidDebugSupport::start()
setQmlServer(m_runner->qmlServer());
//TODO: Not sure if these are the right paths.
if (qtVersion)
addSearchDirectory(qtVersion->qmakeProperty("QT_INSTALL_QML"));
addSearchDirectory(qtVersion->qmlPath().toString());
}
// FIXME: Move signal to base class and generalize handling.

View File

@@ -180,7 +180,7 @@ void QbsManager::addQtProfileFromKit(const QString &profileName, const ProjectEx
if (qtEnv.qtConfigItems.contains(buildVariant))
qtEnv.buildVariant << buildVariant;
}
qtEnv.qmlPath = qt->qmakeProperty("QT_INSTALL_QML");
qtEnv.qmlPath = qt->qmlPath().toString();
qtEnv.qmlImportPath = qt->qmakeProperty("QT_INSTALL_IMPORTS");
const qbs::ErrorInfo errorInfo = qbs::setupQtProfile(profileName, settings(), qtEnv);
if (errorInfo.hasError()) {

View File

@@ -123,7 +123,7 @@ void BasicBundleProvider::mergeBundlesForKit(ProjectExplorer::Kit *kit
return;
}
QString qtImportsPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
QString qtQmlPath = qtVersion->qmakeProperty("QT_INSTALL_QML");
QString qtQmlPath = qtVersion->qmlPath().toString();
QSet<Core::Id> features = qtVersion->availableFeatures();
if (features.contains(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX)) {

View File

@@ -116,7 +116,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
preferDebugDump = (qtVersion->defaultBuildConfig() & QtSupport::BaseQtVersion::DebugBuild);
if (qtVersion && qtVersion->isValid()) {
projectInfo.tryQmlDump = project && qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT);
projectInfo.qtQmlPath = QFileInfo(qtVersion->qmakeProperty("QT_INSTALL_QML")).canonicalFilePath();
projectInfo.qtQmlPath = qtVersion->qmlPath().toFileInfo().canonicalFilePath();
projectInfo.qtImportsPath = QFileInfo(qtVersion->qmakeProperty("QT_INSTALL_IMPORTS")).canonicalFilePath();
projectInfo.qtVersionString = qtVersion->qtVersionString();
} else {

View File

@@ -249,7 +249,7 @@ void QmlProfilerDetailsRewriter::populateFileFinder(const ProjectExplorer::Targe
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(kit))
activeSysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString();
if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(kit))
additionalSearchDirectories.append(qtVersion->qmakeProperty("QT_INSTALL_QML"));
additionalSearchDirectories.append(qtVersion->qmlPath().toString());
}
}

View File

@@ -244,7 +244,7 @@ QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles()
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_PLUGINS")));
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_IMPORTS")));
result.append(gatherFiles(qtVersion->qmakeProperty("QT_INSTALL_QML")));
result.append(gatherFiles(qtVersion->qmlPath().toString()));
return result;
}

View File

@@ -321,6 +321,10 @@ void BaseQtVersion::setupExpander()
QtKitInformation::tr("The installation location of the current Qt version's plugins."),
[this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_PLUGINS"); });
m_expander.registerVariable("Qt:QT_INSTALL_QML",
QtKitInformation::tr("The installation location of the current Qt version's QML files."),
[this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_QML"); });
m_expander.registerVariable("Qt:QT_INSTALL_IMPORTS",
QtKitInformation::tr("The installation location of the current Qt version's imports."),
[this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_IMPORTS"); });
@@ -560,6 +564,11 @@ FileName BaseQtVersion::pluginPath() const
return FileName::fromUserInput(qmakeProperty("QT_INSTALL_PLUGINS"));
}
FileName BaseQtVersion::qmlPath() const
{
return FileName::fromUserInput(qmakeProperty("QT_INSTALL_QML"));
}
FileName BaseQtVersion::binPath() const
{
return FileName::fromUserInput(qmakeProperty("QT_HOST_BINS"));

View File

@@ -209,6 +209,7 @@ public:
Utils::FileName docsPath() const;
Utils::FileName libraryPath() const;
Utils::FileName pluginPath() const;
Utils::FileName qmlPath() const;
Utils::FileName binPath() const;
Utils::FileName mkspecsPath() const;