diff options
author | Marco Bubke <[email protected]> | 2024-02-29 16:37:20 +0100 |
---|---|---|
committer | Marco Bubke <[email protected]> | 2024-03-04 17:22:23 +0000 |
commit | b3718ad783d42ab7e1ef502492dec324a750ca79 (patch) | |
tree | 62861d1524ec456d12793664bb1521435937b44a /src/plugins | |
parent | d4426f34246dd3eafcb8fb2ad3c5c3596ae11324 (diff) |
QmlDesigner: Enforce lite plugin if lite is enabled
You need to remove the build or set the project storage option too.
Task-number: QDS-12102
Change-Id: I45eb30fa18f56c170344afdaf94275b944230fa5
Reviewed-by: Qt CI Patch Build Bot <[email protected]>
Reviewed-by: <[email protected]>
Reviewed-by: Thomas Hartmann <[email protected]>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmldesigner/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h | 9 | ||||
-rw-r--r-- | src/plugins/qmldesigner/qmldesignerplugin.cpp | 12 |
3 files changed, 27 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index bb274f7703a..66af859a61b 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -10,9 +10,11 @@ endif() add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,GNU>:-Wno-error=maybe-uninitialized>") -env_with_default("QDS_USE_PROJECTSTORAGE" ENV_QDS_USE_PROJECTSTORAGE OFF) -option(USE_PROJECTSTORAGE "Use ProjectStorage" ${ENV_QDS_USE_PROJECTSTORAGE}) -add_feature_info("ProjectStorage" ${USE_PROJECTSTORAGE} "") +set(BUILD_NOT_DESIGNSTUDIO NOT ${BUILD_NOT_DESIGNSTUDIO}) +option(QTC_USE_QML_DESIGNER_LITE "Use Qml Designer Lite" ${BUILD_NOT_DESIGNSTUDIO}) +add_feature_info("Qml Designer Lite" ${QTC_USE_QML_DESIGNER_LITE} "") + +option(USE_PROJECTSTORAGE "Use ProjectStorage" ${QTC_USE_QML_DESIGNER_LITE}) env_with_default("QTC_ENABLE_PROJECT_STORAGE_TRACING" ENV_QTC_ENABLE_PROJECT_STORAGE_TRACING OFF) option(ENABLE_PROJECT_STORAGE_TRACING "Enable sqlite tracing" ${ENV_QTC_ENABLE_PROJECT_STORAGE_TRACING}) @@ -79,6 +81,7 @@ add_qtc_library(QmlDesignerCore STATIC Sqlite DEFINES $<$<BOOL:${USE_PROJECTSTORAGE}>:QDS_USE_PROJECTSTORAGE> + $<$<BOOL:${QTC_USE_QML_DESIGNER_LITE}>:QTC_USE_QML_DESIGNER_LITE> INCLUDES ${CMAKE_CURRENT_LIST_DIR} PUBLIC_INCLUDES @@ -484,6 +487,7 @@ add_qtc_plugin(QmlDesigner IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\" SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner" $<$<BOOL:${USE_PROJECTSTORAGE}>:QDS_USE_PROJECTSTORAGE> + $<$<BOOL:${QTC_USE_QML_DESIGNER_LITE}>:QTC_USE_QML_DESIGNER_LITE> INCLUDES ${CMAKE_CURRENT_LIST_DIR}/components ${CMAKE_CURRENT_LIST_DIR}/components/assetslibrary diff --git a/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h b/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h index 7871b5df3a6..57ef521d867 100644 --- a/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h +++ b/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h @@ -33,4 +33,13 @@ enum AnchorLineType { AnchorLineAllMask = AnchorLineVerticalMask | AnchorLineHorizontalMask }; +constexpr bool isUsingQmlDesignerLite() +{ +#ifdef QTC_USE_QML_DESIGNER_LITE + return true; +#else + return false; +#endif +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index fda96d2d964..cd0ffaba263 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -73,10 +73,11 @@ #include <utils/qtcassert.h> #include <utils/uniqueobjectptr.h> +#include <qplugin.h> #include <QAction> #include <QApplication> #include <QDebug> -#include <qplugin.h> +#include <QMessageBox> #include <QProcessEnvironment> #include <QQuickItem> #include <QScreen> @@ -259,6 +260,15 @@ QmlDesignerPlugin::~QmlDesignerPlugin() //////////////////////////////////////////////////// bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage/* = 0*/) { + if constexpr (isUsingQmlDesignerLite()) { + if (!QmlDesignerBasePlugin::isLiteModeEnabled()) { + QMessageBox::warning(Core::ICore::dialogParent(), + tr("Qml Designer Lite"), + tr("The Qml Designer Lite plugin is not enabled.")); + return false; + } + } + Sqlite::LibraryInitializer::initialize(); QDir{}.mkpath(Core::ICore::cacheResourcePath().toString()); |