aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/geometrybase.h
blob: a50009b0c8a5aedf6ba9c550cb672e2a502b3c08 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#ifdef QUICK3D_MODULE

#include <QtQuick3D/private/qquick3dgeometry_p.h>

#include <QTimer>

namespace QmlDesigner {
namespace Internal {

class GeometryBase : public QQuick3DGeometry
{
    Q_OBJECT

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
    // Name property was removed in Qt 6, so define it here for compatibility.
    // Name maps to object name.
    Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
public:
    QString name() const;
    void setName(const QString &name);
signals:
    void nameChanged();
#endif

public:
    GeometryBase();
    ~GeometryBase() override;

protected:
    void updateGeometry();
    virtual void doUpdateGeometry();

private:
    QTimer m_updatetimer;
};

}
}

QML_DECLARE_TYPE(QmlDesigner::Internal::GeometryBase)

#endif // QUICK3D_MODULE