aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/recursiveObject.h
blob: a3d517e18bcacf82c827b17353201dcc1bb04f36 (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) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef RECURSIVEOBJECT_H
#define RECURSIVEOBJECT_H

#include <QtQmlIntegration/qqmlintegration.h>

#include <QtCore/qobject.h>
#include <QtCore/qvariantmap.h>

class RecursiveObject : public QObject
{
    Q_OBJECT
    QML_ELEMENT
public:

    Q_INVOKABLE QVariantMap getObject() {
        return QVariantMap { {
            QLatin1String("sub"),
            QVariantMap { {QLatin1String("name"), QString::number(index++)} }
        } };
    }

private:
    int index = 0;
};

#endif // RECURSIVEOBJECT_H