forked from qt-creator/qt-creator
QmlPuppet: Force QApplication use in puppet if charts is imported
Qt Charts requires QApplication, so force that on when QtCharts import is detected. Change-Id: Ie725cb0714f2816a34374e46de71b82f00ce6239 Fixes: QDS-2842 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -149,7 +149,9 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
//If a style different from Desktop is set we have to use QGuiApplication
|
||||
bool useGuiApplication = qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")
|
||||
bool useGuiApplication = (!qEnvironmentVariableIsSet("QMLDESIGNER_FORCE_QAPPLICATION")
|
||||
|| qgetenv("QMLDESIGNER_FORCE_QAPPLICATION") != "true")
|
||||
&& qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")
|
||||
&& qgetenv("QT_QUICK_CONTROLS_STYLE") != "Desktop";
|
||||
|
||||
if (useGuiApplication) {
|
||||
|
@@ -499,6 +499,9 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
||||
QmlDesigner::Import import = QmlDesigner::Import::createLibraryImport("QtQuick3D", "1.0");
|
||||
if (m_model->hasImport(import, true, true))
|
||||
environment.set("QMLDESIGNER_QUICK3D_MODE", "true");
|
||||
import = QmlDesigner::Import::createLibraryImport("QtCharts", "2.0");
|
||||
if (m_model->hasImport(import, true, true))
|
||||
environment.set("QMLDESIGNER_FORCE_QAPPLICATION", "true");
|
||||
#endif
|
||||
|
||||
QStringList importPaths = m_model->importPaths();
|
||||
|
Reference in New Issue
Block a user