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#include "qspritesheetitem.h"
5#include "qspritesheetitem_p.h"
6
7QT_BEGIN_NAMESPACE
8
9using namespace Qt3DCore;
10
11namespace Qt3DExtras {
12
13QSpriteSheetItemPrivate::QSpriteSheetItemPrivate()
14 : QNodePrivate()
15 , m_x(0)
16 , m_y(0)
17 , m_width(0)
18 , m_height(0)
19{
20
21}
22
23QSpriteSheetItem::QSpriteSheetItem(QNode *parent)
24 : Qt3DCore::QNode(* new QSpriteSheetItemPrivate(), parent)
25{
26
27}
28
29int QSpriteSheetItem::x() const
30{
31 Q_D(const QSpriteSheetItem);
32 return d->m_x;
33}
34
35void QSpriteSheetItem::setX(int x)
36{
37 Q_D(QSpriteSheetItem);
38 if (x != d->m_x) {
39 d->m_x = x;
40 emit xChanged(x);
41 }
42}
43
44int QSpriteSheetItem::y() const
45{
46 Q_D(const QSpriteSheetItem);
47 return d->m_y;
48}
49
50void QSpriteSheetItem::setY(int y)
51{
52 Q_D(QSpriteSheetItem);
53 if (y != d->m_y) {
54 d->m_y = y;
55 emit yChanged(y);
56 }
57}
58
59int QSpriteSheetItem::width() const
60{
61 Q_D(const QSpriteSheetItem);
62 return d->m_width;
63}
64
65void QSpriteSheetItem::setWidth(int width)
66{
67 Q_D(QSpriteSheetItem);
68 if (width != d->m_width) {
69 d->m_width = width;
70 emit widthChanged(width);
71 }
72}
73
74int QSpriteSheetItem::height() const
75{
76 Q_D(const QSpriteSheetItem);
77 return d->m_height;
78}
79
80void QSpriteSheetItem::setHeight(int height)
81{
82 Q_D(QSpriteSheetItem);
83 if (height != d->m_height) {
84 d->m_height = height;
85 emit heightChanged(height);
86 }
87}
88
89} // namespace Qt3DExtras
90
91QT_END_NAMESPACE
92
93#include "moc_qspritesheetitem.cpp"
94

source code of qt3d/src/extras/defaults/qspritesheetitem.cpp