aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/effectcomposer/effectcomposerplugin.cpp
blob: d79e00a78d18d743fe6d0f36920690317e8cfcf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include <effectcomposerview.h>

#include <qmldesignerplugin.h>
#include <coreplugin/icore.h>

#include <extensionsystem/iplugin.h>

namespace EffectComposer {

class EffectComposerPlugin final : public ExtensionSystem::IPlugin
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "EffectComposer.json")

public:
    EffectComposerPlugin() {}
    ~EffectComposerPlugin() override {}

    void initialize() final
    {
        EffectComposerView::registerDeclarativeTypes();
    }

    bool delayedInitialize() override
    {
        auto *designerPlugin = QmlDesigner::QmlDesignerPlugin::instance();
        auto &viewManager = designerPlugin->viewManager();

        viewManager.registerView(std::make_unique<EffectComposerView>(
            QmlDesigner::QmlDesignerPlugin::externalDependenciesForPluginInitializationOnly()));
        return true;
    }
};

} // namespace EffectComposer

#include "effectcomposerplugin.moc"