summaryrefslogtreecommitdiff
path: root/tests/projects/qt/quickplugin/src/Foo.h
blob: 71e2b0e239a32980aa65433791b430786d2d5aba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <QtCore/QObject>
#include <QtQml/qqml.h>

class Foo: public QObject {
    Q_OBJECT
    Q_PROPERTY(int bar READ bar WRITE setBar NOTIFY barChanged)
    QML_NAMED_ELEMENT(Foo)

    public:
        explicit Foo(QObject *parent = nullptr);

        int bar() const noexcept;
        void setBar(int bar) noexcept;

    Q_SIGNALS:
        void barChanged(int bar);

    private:
        int m_bar;
};

QML_DECLARE_TYPE(Foo)