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

#ifndef COLLECTOR_H
#define COLLECTOR_H

#include <QtCore/qobject.h>
#include <QtQmlIntegration/qqmlintegration.h>
#include <QtQml/qjsengine.h>

class Collector : public QObject
{
    Q_OBJECT
    QML_ELEMENT
    Q_PROPERTY(int gc READ gc CONSTANT)

public:
    int gc() const
    {
        qjsEngine(this)->collectGarbage();
        return 1;
    }
};

#endif // COLLECTOR_H