1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DCORE_COMPONENT_H |
5 | #define QT3DCORE_COMPONENT_H |
6 | |
7 | #include <Qt3DCore/qnode.h> |
8 | #include <Qt3DCore/qt3dcore_global.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace Qt3DCore { |
13 | |
14 | class QEntity; |
15 | class QComponentPrivate; |
16 | |
17 | class Q_3DCORESHARED_EXPORT QComponent : public QNode |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(bool isShareable READ isShareable WRITE setShareable NOTIFY shareableChanged) |
21 | |
22 | public: |
23 | explicit QComponent(QNode *parent = nullptr); |
24 | ~QComponent(); |
25 | |
26 | bool isShareable() const; |
27 | |
28 | QList<QEntity *> entities() const; |
29 | |
30 | public Q_SLOTS: |
31 | void setShareable(bool isShareable); |
32 | |
33 | Q_SIGNALS: |
34 | void shareableChanged(bool isShareable); |
35 | void addedToEntity(QEntity *entity); |
36 | void removedFromEntity(QEntity *entity); |
37 | |
38 | protected: |
39 | explicit QComponent(QComponentPrivate &dd, QNode *parent = nullptr); |
40 | |
41 | private: |
42 | Q_DECLARE_PRIVATE(QComponent) |
43 | }; |
44 | |
45 | } // namespace Qt3DCore |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif // QT3DCORE_COMPONENT_H |
50 | |