forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.11'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/mcusupport/mcusupportrunconfiguration.cpp src/plugins/python/pythonproject.cpp src/plugins/qmakeprojectmanager/qmakestep.cpp src/plugins/qmlprojectmanager/qmlproject.cpp src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp Change-Id: I22507be28fd80c49c9fee0dff5937a40db176a82
This commit is contained in:
@@ -93,6 +93,10 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi
|
||||
if (fileSelectorsProperty.isValid())
|
||||
projectItem->setFileSelectors(fileSelectorsProperty.toStringList());
|
||||
|
||||
const QVariant forceFreeTypeProperty = rootNode->property("forceFreeType");
|
||||
if (forceFreeTypeProperty.isValid())
|
||||
projectItem->setForceFreeType(forceFreeTypeProperty.toBool());
|
||||
|
||||
const QVariant targetDirectoryPropery = rootNode->property("targetDirectory");
|
||||
if (targetDirectoryPropery.isValid())
|
||||
projectItem->setTargetDirectory(targetDirectoryPropery.toString());
|
||||
|
||||
@@ -97,6 +97,11 @@ bool QmlProjectItem::matchesFile(const QString &filePath) const
|
||||
});
|
||||
}
|
||||
|
||||
void QmlProjectItem::setForceFreeType(bool b)
|
||||
{
|
||||
m_forceFreeType = b;
|
||||
}
|
||||
|
||||
Utils::EnvironmentItems QmlProjectItem::environment() const
|
||||
{
|
||||
return m_environment;
|
||||
|
||||
@@ -60,6 +60,9 @@ public:
|
||||
QStringList files() const;
|
||||
bool matchesFile(const QString &filePath) const;
|
||||
|
||||
bool forceFreeType() const { return m_forceFreeType; };
|
||||
void setForceFreeType(bool);
|
||||
|
||||
QString mainFile() const { return m_mainFile; }
|
||||
void setMainFile(const QString &mainFilePath) { m_mainFile = mainFilePath; }
|
||||
|
||||
@@ -79,6 +82,7 @@ protected:
|
||||
QString m_mainFile;
|
||||
Utils::EnvironmentItems m_environment;
|
||||
QVector<QmlProjectContentItem *> m_content; // content property
|
||||
bool m_forceFreeType = false;
|
||||
};
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
@@ -391,6 +391,8 @@ QVariant QmlBuildSystem::additionalData(Id id) const
|
||||
{
|
||||
if (id == Constants::customFileSelectorsData)
|
||||
return customFileSelectors();
|
||||
if (id == Constants::customForceFreeTypeData)
|
||||
return forceFreeType();
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -418,6 +420,13 @@ QmlProject *QmlBuildSystem::qmlProject() const
|
||||
return static_cast<QmlProject *>(BuildSystem::project());
|
||||
}
|
||||
|
||||
bool QmlBuildSystem::forceFreeType() const
|
||||
{
|
||||
if (m_projectItem)
|
||||
return m_projectItem.data()->forceFreeType();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QmlBuildSystem::addFiles(Node *context, const QStringList &filePaths, QStringList *)
|
||||
{
|
||||
if (!dynamic_cast<QmlProjectNode *>(context))
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
Utils::EnvironmentItems environment() const;
|
||||
QStringList customImportPaths() const;
|
||||
QStringList customFileSelectors() const;
|
||||
bool forceFreeType() const;
|
||||
|
||||
bool addFiles(const QStringList &filePaths);
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Constants {
|
||||
|
||||
const char * const QMLPROJECT_MIMETYPE = QmlJSTools::Constants::QMLPROJECT_MIMETYPE;
|
||||
const char customFileSelectorsData[] = "CustomFileSelectorsData";
|
||||
const char customForceFreeTypeData[] = "CustomForceFreeType";
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
@@ -396,6 +396,11 @@ QString QmlProjectRunConfiguration::commandLineArguments() const
|
||||
QtcProcess::addArg(&args, fileSelector, osType);
|
||||
}
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost() && bs->forceFreeType()) {
|
||||
Utils::QtcProcess::addArg(&args, "-platform", osType);
|
||||
Utils::QtcProcess::addArg(&args, "windows:fontengine=freetype", osType);
|
||||
}
|
||||
|
||||
const QString main = bs->targetFile(FilePath::fromString(mainScript())).toString();
|
||||
if (!main.isEmpty())
|
||||
QtcProcess::addArg(&args, main, osType);
|
||||
|
||||
Reference in New Issue
Block a user