forked from qt-creator/qt-creator
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:
@@ -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
|
||||||
|
@@ -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"
|
||||||
|
@@ -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
|
|
||||||
|
|
Reference in New Issue
Block a user