aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp')
-rw-r--r--src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
index f480e9bb97..c74c41b323 100644
--- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp
@@ -36,17 +36,20 @@
#include <app/app_version.h>
+#include <coreplugin/messagebox.h>
+#include <coreplugin/icore.h>
+
#include <projectexplorer/kit.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
-#include <coreplugin/messagebox.h>
-#include <coreplugin/icore.h>
+
+#include <qmlprojectmanager/qmlmultilanguageaspect.h>
+
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
-#include <coreplugin/icore.h>
#include <utils/algorithm.h>
#include <utils/environment.h>
@@ -68,6 +71,8 @@
static Q_LOGGING_CATEGORY(puppetStart, "qtc.puppet.start", QtWarningMsg)
static Q_LOGGING_CATEGORY(puppetBuild, "qtc.puppet.build", QtWarningMsg)
+using namespace ProjectExplorer;
+
namespace QmlDesigner {
class EventFilter : public QObject {
@@ -86,7 +91,7 @@ public:
}
};
-QHash<Core::Id, PuppetCreator::PuppetType> PuppetCreator::m_qml2PuppetForKitPuppetHash;
+QHash<Utils::Id, PuppetCreator::PuppetType> PuppetCreator::m_qml2PuppetForKitPuppetHash;
QByteArray PuppetCreator::qtHash() const
{
@@ -268,7 +273,7 @@ static QString idealProcessCount()
bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const
{
PuppetBuildProgressDialog progressDialog;
- progressDialog.setParent(Core::ICore::mainWindow());
+ progressDialog.setParent(Core::ICore::dialogParent());
m_compileLog.clear();
@@ -508,8 +513,17 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
importPaths.append(designerImports);
customFileSelectors = m_target->additionalData("CustomFileSelectorsData").toStringList();
+
+ if (auto *rc = m_target->activeRunConfiguration()) {
+ if (auto multiLanguageAspect = rc->aspect<QmlProjectManager::QmlMultiLanguageAspect>()) {
+ if (!multiLanguageAspect->databaseFilePath().isEmpty())
+ environment.set("QT_MULTILANGUAGE_DATABASE", multiLanguageAspect->databaseFilePath().toString());
+ }
+ }
}
+ customFileSelectors.append("DesignMode");
+
if (m_availablePuppetType == FallbackPuppet)
importPaths.prepend(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath));
@@ -532,11 +546,7 @@ QString PuppetCreator::buildCommand() const
Utils::Environment environment = Utils::Environment::systemEnvironment();
m_target->kit()->addToEnvironment(environment);
- ProjectExplorer::ToolChain *toolChain
- = ProjectExplorer::ToolChainKitAspect::toolChain(m_target->kit(),
- ProjectExplorer::Constants::CXX_LANGUAGE_ID);
-
- if (toolChain)
+ if (ToolChain *toolChain = ToolChainKitAspect::cxxToolChain(m_target->kit()))
return toolChain->makeCommand(environment).toString();
return QString();