1 | // Copyright (C) 2017 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 QT3DEXTRAS_QSPRITESHEET_H |
5 | #define QT3DEXTRAS_QSPRITESHEET_H |
6 | |
7 | #include <Qt3DExtras/qabstractspritesheet.h> |
8 | #include <Qt3DExtras/qspritesheetitem.h> |
9 | #include <QtCore/QList> |
10 | #include <QtCore/QRect> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | namespace Qt3DExtras { |
15 | |
16 | class QSpriteSheetPrivate; |
17 | |
18 | class Q_3DEXTRASSHARED_EXPORT QSpriteSheet : public QAbstractSpriteSheet |
19 | { |
20 | Q_OBJECT |
21 | Q_PROPERTY(QList<QSpriteSheetItem *> sprites READ sprites WRITE setSprites NOTIFY spritesChanged) |
22 | public: |
23 | explicit QSpriteSheet(Qt3DCore::QNode *parent = nullptr); |
24 | ~QSpriteSheet(); |
25 | |
26 | QList<QSpriteSheetItem *> sprites() const; |
27 | QSpriteSheetItem *addSprite(int x, int y, int width, int height); |
28 | void addSprite(QSpriteSheetItem *sprite); |
29 | void removeSprite(QSpriteSheetItem *sprite); |
30 | |
31 | public Q_SLOTS: |
32 | void setSprites(QList<QSpriteSheetItem *> sprites); |
33 | |
34 | Q_SIGNALS: |
35 | void spritesChanged(QList<QSpriteSheetItem *> sprites); |
36 | |
37 | private: |
38 | Q_DECLARE_PRIVATE(QSpriteSheet) |
39 | }; |
40 | |
41 | } // Qt3DExtras |
42 | |
43 | QT_END_NAMESPACE |
44 | |
45 | #endif // QT3DEXTRAS_QSPRITESHEET_H |
46 |