| 1 | // Copyright (C) 2020 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 | #ifndef QT3DEXTRAS_EXTRAS_QUICK_QUICK3DSPRITESHEET_P_H |
| 4 | #define |
| 5 | |
| 6 | // |
| 7 | // W A R N I N G |
| 8 | // ------------- |
| 9 | // |
| 10 | // This file is not part of the Qt API. It exists for the convenience |
| 11 | // of other Qt classes. This header file may change from version to |
| 12 | // version without notice, or even be removed. |
| 13 | // |
| 14 | // We mean it. |
| 15 | // |
| 16 | |
| 17 | #include <Qt3DQuickExtras/qt3dquickextras_global.h> |
| 18 | #include <Qt3DExtras/qspritesheet.h> |
| 19 | #include <QtQml/QQmlListProperty> |
| 20 | #include <QtQml/qqmlregistration.h> |
| 21 | #include <private/qglobal_p.h> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | namespace Qt3DExtras { |
| 26 | namespace Extras { |
| 27 | namespace Quick { |
| 28 | |
| 29 | class Q_3DQUICKEXTRASSHARED_EXPORT : public QObject |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | Q_PROPERTY(QQmlListProperty<Qt3DExtras::QSpriteSheetItem> sprites READ sprites CONSTANT) |
| 33 | Q_CLASSINFO("DefaultProperty" , "sprites" ) |
| 34 | public: |
| 35 | explicit (QObject *parent = 0); |
| 36 | (); |
| 37 | |
| 38 | QQmlListProperty<Qt3DExtras::QSpriteSheetItem> (); |
| 39 | inline QSpriteSheet *() const { return qobject_cast<QSpriteSheet *>(object: parent()); } |
| 40 | }; |
| 41 | |
| 42 | class |
| 43 | { |
| 44 | Q_GADGET |
| 45 | QML_NAMED_ELEMENT(SpriteSheet) |
| 46 | QML_FOREIGN(Qt3DExtras::QSpriteSheet) |
| 47 | QML_EXTENDED(Qt3DExtras::Extras::Quick::Quick3DSpriteSheet) |
| 48 | QML_ADDED_IN_VERSION(2, 10) |
| 49 | }; |
| 50 | |
| 51 | } // namespace Quick |
| 52 | } // namespace Extras |
| 53 | } // namespace Qt3DExtras |
| 54 | |
| 55 | QT_END_NAMESPACE |
| 56 | |
| 57 | #endif // QT3DEXTRAS_EXTRAS_QUICK_QUICK3DSPRITESHEET_P_H |
| 58 | |