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

#include "attached.h"

Attached::Attached(QObject *parent) :
    QObject(parent)
{
}

int Attached::a() const
{
    return mA;
}

void Attached::setA(int a)
{
    // Intentionally omit the early return in order to force a binding loop.

    mA = a;
    emit aChanged();
}

Attached *Attached::qmlAttachedProperties(QObject *object)
{
    return new Attached(object);
}