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
12QT_BEGIN_NAMESPACE
13
14namespace Qt3DExtras {
15
16class QSpriteSheetPrivate;
17
18class Q_3DEXTRASSHARED_EXPORT QSpriteSheet : public QAbstractSpriteSheet
19{
20 Q_OBJECT
21 Q_PROPERTY(QList<QSpriteSheetItem *> sprites READ sprites WRITE setSprites NOTIFY spritesChanged)
22public:
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
31public Q_SLOTS:
32 void setSprites(QList<QSpriteSheetItem *> sprites);
33
34Q_SIGNALS:
35 void spritesChanged(QList<QSpriteSheetItem *> sprites);
36
37private:
38 Q_DECLARE_PRIVATE(QSpriteSheet)
39};
40
41} // Qt3DExtras
42
43QT_END_NAMESPACE
44
45#endif // QT3DEXTRAS_QSPRITESHEET_H
46

source code of qt3d/src/extras/defaults/qspritesheet.h