aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/integration/componentaction.h
blob: 86c168b44d0b91457f001dd56686d8241c6f135d (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) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <QWidgetAction>
#include <QPointer>

QT_BEGIN_NAMESPACE
class QComboBox;
QT_END_NAMESPACE

namespace QmlDesigner {

class Model;
class ComponentView;
class ModelNode;

class ComponentAction : public QWidgetAction
{
    Q_OBJECT
public:
    ComponentAction(ComponentView  *componentView);
    void setCurrentIndex(int index);
    void emitCurrentComponentChanged(int index);

protected:
    QWidget *createWidget(QWidget *parent) override;

signals:
    void currentComponentChanged(const ModelNode &node);
    void changedToMaster();
    void currentIndexChanged(int index);

private:
    QPointer<ComponentView> m_componentView;
    bool dontEmitCurrentComponentChanged;
};

} // namespace QmlDesigner