aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/gadgetwithenum.h
blob: 839e026b77a21ad16dfa3b10f6e021bd1d9e3a11 (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
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef GADGETWITHENUM_H
#define GADGETWITHENUM_H

#include <QtCore/qobject.h>
#include <QtQml/qqml.h>

class GadgetWithEnum : public QObject {
    Q_GADGET
    QML_ELEMENT

public:
    enum State {
        DISCONNECTED,
        CONNECTING,
        CONNECTED
    };
    Q_ENUM(State)
};

namespace GadgetWithEnumWrapper {
    Q_NAMESPACE
    QML_FOREIGN_NAMESPACE(GadgetWithEnum)
    QML_NAMED_ELEMENT(NamespaceWithEnum)
};

#endif // GADGETWITHENUM_H