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