forked from qt-creator/qt-creator
QmlDesigner: Forward QT_IM_MODULE=qtvirtualkeyboard to puppet
If QT_IM_MODULE=qtvirtualkeyboard is used for the application, when we should also set it for the puppet. Task-number: QDS-3859 Change-Id: Id88132cebbb7aeddb3fbb8ff1e8aa5191cc89d15 Reviewed-by: Tuomo Pelkonen <tuomo.pelkonen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
|
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
|
||||||
|
|
||||||
|
#include <qmlprojectmanager/qmlproject.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
@@ -167,6 +168,20 @@ QString PuppetCreator::getStyleConfigFileName() const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PuppetCreator::usesVirtualKeyboard() const
|
||||||
|
{
|
||||||
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
if (m_target) {
|
||||||
|
auto *qmlbuild = qobject_cast<QmlProjectManager::QmlBuildSystem *>(m_target->buildSystem());
|
||||||
|
|
||||||
|
const Utils::EnvironmentItem virtualKeyboard("QT_IM_MODULE", "qtvirtualkeyboard");
|
||||||
|
return qmlbuild && qmlbuild->environment().indexOf(virtualKeyboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
PuppetCreator::PuppetCreator(ProjectExplorer::Target *target, const Model *model)
|
PuppetCreator::PuppetCreator(ProjectExplorer::Target *target, const Model *model)
|
||||||
|
|
||||||
: m_target(target)
|
: m_target(target)
|
||||||
@@ -494,6 +509,11 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
|||||||
environment.set("QMLDESIGNER_RC_PATHS", m_qrcMapping);
|
environment.set("QMLDESIGNER_RC_PATHS", m_qrcMapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (usesVirtualKeyboard()) {
|
||||||
|
environment.set("QT_IM_MODULE", "qtvirtualkeyboard");
|
||||||
|
environment.set("QT_VIRTUALKEYBOARD_DESKTOP_DISABLE", "1");
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
// set env var if QtQuick3D import exists
|
// set env var if QtQuick3D import exists
|
||||||
QmlDesigner::Import import = QmlDesigner::Import::createLibraryImport("QtQuick3D", "1.0");
|
QmlDesigner::Import import = QmlDesigner::Import::createLibraryImport("QtQuick3D", "1.0");
|
||||||
|
@@ -103,6 +103,7 @@ protected:
|
|||||||
|
|
||||||
bool useOnlyFallbackPuppet() const;
|
bool useOnlyFallbackPuppet() const;
|
||||||
QString getStyleConfigFileName() const;
|
QString getStyleConfigFileName() const;
|
||||||
|
bool usesVirtualKeyboard() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QString m_compileLog;
|
mutable QString m_compileLog;
|
||||||
|
Reference in New Issue
Block a user