EffektMaker: Move plugin class definition to .cpp

And clean up a bit.

Change-Id: I735c5af3d2806b78564095c9ad0f748f2821e787
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
This commit is contained in:
hjk
2023-12-13 17:53:16 +01:00
parent c70b051cfe
commit 57182b7fe9
3 changed files with 16 additions and 63 deletions

View File

@@ -6,7 +6,7 @@ add_qtc_plugin(EffectMakerNew
Qt::Core Qt::CorePrivate Qt::Widgets Qt::Qml Qt::QmlPrivate Qt::Quick Qt::Core Qt::CorePrivate Qt::Widgets Qt::Qml Qt::QmlPrivate Qt::Quick
QtCreator::Utils QtCreator::Utils
SOURCES SOURCES
effectmakerplugin.cpp effectmakerplugin.h effectmakerplugin.cpp
effectmakerwidget.cpp effectmakerwidget.h effectmakerwidget.cpp effectmakerwidget.h
effectmakerview.cpp effectmakerview.h effectmakerview.cpp effectmakerview.h
effectmakermodel.cpp effectmakermodel.h effectmakermodel.cpp effectmakermodel.h

View File

@@ -1,46 +1,31 @@
// Copyright (C) 2023 The Qt Company Ltd. // Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "effectmakerplugin.h"
#include "effectmakerview.h" #include "effectmakerview.h"
#include <coreplugin/actionmanager/actionmanager.h> #include <extensionsystem/iplugin.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/imode.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/messagemanager.h>
#include <coreplugin/externaltool.h>
#include <coreplugin/externaltoolmanager.h>
#include <componentcore_constants.h>
#include <designeractionmanager.h>
#include <viewmanager.h> #include <viewmanager.h>
#include <qmldesigner/dynamiclicensecheck.h>
#include <qmldesignerplugin.h> #include <qmldesignerplugin.h>
#include <modelnodeoperations.h>
#include <QJsonDocument>
#include <QMap>
namespace EffectMaker { namespace EffectMaker {
bool EffectMakerPlugin::delayedInitialize() class EffectMakerPlugin final : public ExtensionSystem::IPlugin
{ {
if (m_delayedInitialized) Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "EffectMakerNew.json")
bool delayedInitialize() final
{
auto designerPlugin = QmlDesigner::QmlDesignerPlugin::instance();
auto &viewManager = designerPlugin->viewManager();
viewManager.registerView(std::make_unique<EffectMakerView>(
QmlDesigner::QmlDesignerPlugin::externalDependenciesForPluginInitializationOnly()));
return true; return true;
}
auto *designerPlugin = QmlDesigner::QmlDesignerPlugin::instance(); };
auto &viewManager = designerPlugin->viewManager();
viewManager.registerView(std::make_unique<EffectMakerView>(
QmlDesigner::QmlDesignerPlugin::externalDependenciesForPluginInitializationOnly()));
m_delayedInitialized = true;
return true;
}
} // namespace EffectMaker } // namespace EffectMaker
#include "effectmakerplugin.moc"

View File

@@ -1,32 +0,0 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <extensionsystem/iplugin.h>
#include <utils/process.h>
namespace Core {
class ActionContainer;
class ExternalTool;
}
namespace EffectMaker {
class EffectMakerPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "EffectMakerNew.json")
public:
EffectMakerPlugin() {}
~EffectMakerPlugin() override {}
bool delayedInitialize() override;
private:
bool m_delayedInitialized = false;
};
} // namespace EffectMaker