From 07d8a8109f14205e48fac63bf340dc8e99d8103f Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 10 Jul 2024 15:05:54 +0200 Subject: [PATCH] QmlDesigner: Add and check feature for 3D wizards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In QML Lite Designer mode we do not show 3D wizards. For this we introduce a feature ("QDS.3D") and check for it. Change-Id: Ifca2cea5373181434bee6cb7813ebc64c8df6983 Reviewed-by: Henning Gründl --- .../studio_templates/projects/application-3d/wizard.json | 1 + .../projects/application-extended-3d/wizard.json | 1 + src/plugins/studiowelcome/wizardfactories.cpp | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json index a897fa421ae..cd4b862dc8e 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json +++ b/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json @@ -10,6 +10,7 @@ "fontIconName": "wizardsGeneric", "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}", "platformIndependent": true, + "featuresRequired": [ "QDS.3D" ], "options": [ diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application-extended-3d/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/application-extended-3d/wizard.json index ccd522f7c84..89157dafb01 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/application-extended-3d/wizard.json +++ b/share/qtcreator/qmldesigner/studio_templates/projects/application-extended-3d/wizard.json @@ -10,6 +10,7 @@ "fontIconName": "wizardsGeneric", "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}", "platformIndependent": true, + "featuresRequired": [ "QDS.3D" ], "options": [ diff --git a/src/plugins/studiowelcome/wizardfactories.cpp b/src/plugins/studiowelcome/wizardfactories.cpp index f114466b8da..55749bd914b 100644 --- a/src/plugins/studiowelcome/wizardfactories.cpp +++ b/src/plugins/studiowelcome/wizardfactories.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include #include @@ -47,8 +49,9 @@ void WizardFactories::sortByCategoryAndId() void WizardFactories::filter() { QList acceptedFactories = Utils::filtered(m_factories, [&](auto *wizard) { - return wizard->isAvailable(m_platform) - && wizard->kind() == JsonWizardFactory::ProjectWizard; + const bool liteDesigner = QmlDesigner::QmlDesignerBasePlugin::isLiteModeEnabled(); + return wizard->isAvailable(m_platform) && wizard->kind() == JsonWizardFactory::ProjectWizard + && (!liteDesigner || !wizard->requiredFeatures().contains("QDS.3D")); }); m_factories = acceptedFactories;