aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlinfo/attached.h
blob: 8d4018f88daca6cd4d92354397cef2b8a0fd3846 (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
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include <QtQml/qqml.h>

class Attached : public QObject
{
    Q_OBJECT
    Q_PROPERTY(int a READ a WRITE setA NOTIFY aChanged)
    QML_ELEMENT
    QML_ATTACHED(Attached)
    QML_UNCREATABLE("")

public:
    Attached(QObject *parent = nullptr);

    int a() const;
    void setA(int a);

    static Attached *qmlAttachedProperties(QObject *object);

signals:
    void aChanged();
    void stuffChanged();

private:
    int mA = 0;
};