QmlProject: Add support for setting the environment

This allows setting arbitrary environment variables
in the .qmlproject.
This is required for example qtquickcontrols2.conf
and QT_AUTO_SCREEN_SCALE_FACTOR.

Task-number: QTCREATORBUG-19513
Change-Id: I8421a9fc7f85d24b3564f1b60f383be3838f2af4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2018-01-29 13:38:41 +01:00
parent 09f8bd3ac0
commit ef9ac8f2f4
7 changed files with 43 additions and 0 deletions

View File

@@ -213,6 +213,13 @@ Utils::FileName QmlProject::targetFile(const Utils::FileName &sourceFile,
return Utils::FileName::fromString(QDir::cleanPath(targetDir.absoluteFilePath(relative)));
}
QList<Utils::EnvironmentItem> QmlProject::environment() const
{
if (m_projectItem)
return m_projectItem.data()->environment();
return {};
}
bool QmlProject::validProjectFile() const
{
return !m_projectItem.isNull();