aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/effectmakernew/effectmakerwidget.h
blob: 6f55cbc786ee73c5a6858978fb9a4cc29b435345 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// 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 "qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h"

#include <coreplugin/icontext.h>

#include <QFrame>

class StudioQuickWidget;

namespace EffectMaker {

class EffectMakerView;
class EffectMakerModel;
class EffectMakerNodesModel;

class EffectMakerWidget : public QFrame
{
    Q_OBJECT

public:
    EffectMakerWidget(EffectMakerView *view);
    ~EffectMakerWidget() = default;

    void contextHelp(const Core::IContext::HelpCallback &callback) const;

    static QString qmlSourcesPath();
    void clearSearchFilter();

    void delayedUpdateModel();
    void updateModel();
    void initView();

    StudioQuickWidget *quickWidget() const;
    QPointer<EffectMakerModel> effectMakerModel() const;
    QPointer<EffectMakerNodesModel> effectMakerNodesModel() const;

    Q_INVOKABLE void addEffectNode(const QString &nodeQenPath);
    Q_INVOKABLE void focusSection(int section);

    QSize sizeHint() const override;

protected:
    bool eventFilter(QObject *obj, QEvent *event) override;

private:
    void reloadQmlSource();

    QPointer<EffectMakerModel> m_effectMakerModel;
    QPointer<EffectMakerNodesModel> m_effectMakerNodesModel;
    QPointer<EffectMakerView> m_effectMakerView;
    QPointer<StudioQuickWidget> m_quickWidget;
    QmlDesigner::QmlModelNodeProxy m_backendModelNode;
};

} // namespace EffectMaker