From 581afd3350dff51cf1dfa9bcc034c5ba4c60d483 Mon Sep 17 00:00:00 2001 From: Andrzej Biniek Date: Wed, 26 Mar 2025 11:21:29 +0100 Subject: [PATCH] Add ExtraPropertyEditorManager plugin Task-number: QDS-14898 Change-Id: Ie6cd7fcd33e792574f7ea7fbae979e3eb4a61b4c Reviewed-by: Thomas Hartmann Reviewed-by: Miikka Heikkinen --- src/plugins/CMakeLists.txt | 1 + .../extrapropertyeditormanager/CMakeLists.txt | 12 ++++++++ .../ExtraPropertyEditorManager.json.in | 19 +++++++++++++ .../extrapropertyeditormanagerplugin.cpp | 28 +++++++++++++++++++ .../extrapropertyeditormanagerplugin.h | 18 ++++++++++++ .../extrapropertyeditorview.cpp | 19 +++++++++++++ .../extrapropertyeditorview.h | 23 +++++++++++++++ 7 files changed, 120 insertions(+) create mode 100644 src/plugins/extrapropertyeditormanager/CMakeLists.txt create mode 100644 src/plugins/extrapropertyeditormanager/ExtraPropertyEditorManager.json.in create mode 100644 src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.cpp create mode 100644 src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.h create mode 100644 src/plugins/extrapropertyeditormanager/extrapropertyeditorview.cpp create mode 100644 src/plugins/extrapropertyeditormanager/extrapropertyeditorview.h diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 2ec7c5a3795..4d3499fdf0b 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -111,6 +111,7 @@ if (WITH_QMLDESIGNER) endif() add_subdirectory(qmldesigner ${qmldesigner_builddir}) add_subdirectory(qmldesignerlite) + add_subdirectory(extrapropertyeditormanager) add_subdirectory(effectcomposer) add_subdirectory(studiowelcome) add_subdirectory(insight) diff --git a/src/plugins/extrapropertyeditormanager/CMakeLists.txt b/src/plugins/extrapropertyeditormanager/CMakeLists.txt new file mode 100644 index 00000000000..5959fb20e2a --- /dev/null +++ b/src/plugins/extrapropertyeditormanager/CMakeLists.txt @@ -0,0 +1,12 @@ +add_qtc_plugin(ExtraPropertyEditorManager + CONDITION TARGET QtCreator::QmlDesigner AND NOT QTC_USE_QML_DESIGNER_LITE + PLUGIN_DEPENDS + QtCreator::QmlDesigner + DEPENDS + Qt::Core Qt::CorePrivate QtCreator::Utils + SOURCES + extrapropertyeditormanagerplugin.cpp + extrapropertyeditormanagerplugin.h + extrapropertyeditorview.cpp + extrapropertyeditorview.h +) diff --git a/src/plugins/extrapropertyeditormanager/ExtraPropertyEditorManager.json.in b/src/plugins/extrapropertyeditormanager/ExtraPropertyEditorManager.json.in new file mode 100644 index 00000000000..a6caddc919b --- /dev/null +++ b/src/plugins/extrapropertyeditormanager/ExtraPropertyEditorManager.json.in @@ -0,0 +1,19 @@ +{ + "Id" : "extrapropertyeditormanager", + "DisplayName" : "Extra Property Editor Manager", + "Name" : "ExtraPropertyEditorManager", + "Version" : "${IDE_VERSION}", + "CompatVersion" : "${IDE_VERSION_COMPAT}", + "VendorId" : "theqtcompany", + "Vendor" : "The Qt Company Ltd", + "Copyright" : "${IDE_COPYRIGHT}", + "License" : [ "Commercial Usage", + "", + "Licensees holding valid Qt Enterprise licenses may use this plugin in accordance with the Qt Enterprise License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company." + ], + "Description" : "Plugin for displaying additional instances of property editor.", + "Url" : "https://www.qt.io", + "DocumentationUrl" : "https://doc.qt.io/qtdesignstudio", + "DisabledByDefault": "${NOT_BUILDING_DESIGNSTUDIO}", + ${IDE_PLUGIN_DEPENDENCIES} +} diff --git a/src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.cpp b/src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.cpp new file mode 100644 index 00000000000..3af6d7e6522 --- /dev/null +++ b/src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.cpp @@ -0,0 +1,28 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "extrapropertyeditormanagerplugin.h" +#include "extrapropertyeditorview.h" + +#include +#include + +namespace ExtraPropertyEditorManager { + +bool ExtraPropertyEditorManagerPlugin::initialize(const QStringList &arguments, QString *errorString) +{ + return ExtensionSystem::IPlugin::initialize(arguments, errorString); +} + +bool ExtraPropertyEditorManagerPlugin::delayedInitialize() +{ + auto *designerPlugin = QmlDesigner::QmlDesignerPlugin::instance(); + auto &viewManager = designerPlugin->viewManager(); + viewManager.registerView(std::make_unique( + designerPlugin->imageCache(), + QmlDesigner::QmlDesignerPlugin::externalDependenciesForPluginInitializationOnly())); + + return true; +} + +} // namespace ExtraPropertyEditorManager diff --git a/src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.h b/src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.h new file mode 100644 index 00000000000..42acfd64957 --- /dev/null +++ b/src/plugins/extrapropertyeditormanager/extrapropertyeditormanagerplugin.h @@ -0,0 +1,18 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include + +namespace ExtraPropertyEditorManager { + +class ExtraPropertyEditorManagerPlugin : public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE + "ExtraPropertyEditorManager.json") + public: + bool initialize(const QStringList &arguments, QString *errorString) override; + bool delayedInitialize() override; +}; + +} // namespace ExtraPropertyEditorManager diff --git a/src/plugins/extrapropertyeditormanager/extrapropertyeditorview.cpp b/src/plugins/extrapropertyeditormanager/extrapropertyeditorview.cpp new file mode 100644 index 00000000000..31744775811 --- /dev/null +++ b/src/plugins/extrapropertyeditormanager/extrapropertyeditorview.cpp @@ -0,0 +1,19 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "extrapropertyeditorview.h" + +#include + +namespace QmlDesigner { + +ExtraPropertyEditorView::ExtraPropertyEditorView(class AsynchronousImageCache &imageCache, + ExternalDependenciesInterface &externalDependencies) + : AbstractView{externalDependencies} + , m_imageCache{imageCache} + , m_externalDependencies{externalDependencies} +{} + +ExtraPropertyEditorView::~ExtraPropertyEditorView() {}; + +} // namespace QmlDesigner diff --git a/src/plugins/extrapropertyeditormanager/extrapropertyeditorview.h b/src/plugins/extrapropertyeditormanager/extrapropertyeditorview.h new file mode 100644 index 00000000000..4a09c2cbdeb --- /dev/null +++ b/src/plugins/extrapropertyeditormanager/extrapropertyeditorview.h @@ -0,0 +1,23 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include + +namespace QmlDesigner { + +class ExtraPropertyEditorView : public AbstractView +{ + Q_OBJECT +public: + ExtraPropertyEditorView(class AsynchronousImageCache &imageCache, + ExternalDependenciesInterface &externalDependencies); + ~ExtraPropertyEditorView() override; + +private: + AsynchronousImageCache &m_imageCache; + ExternalDependenciesInterface &m_externalDependencies; +}; + +} // namespace QmlDesigner