summaryrefslogtreecommitdiffstats
path: root/pacman-c++/pixmapitem.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-03 17:01:08 +0200
committermanuel <manuel@mausz.at>2011-04-03 17:01:08 +0200
commit11e767ea030cbdab3f0374f61efc3a813746fad5 (patch)
tree8351c8b61092874286f9f78f96ad8b5d86ca66e6 /pacman-c++/pixmapitem.cpp
parent818383fec4f220a2410177b58518797e81d8eab3 (diff)
downloadfoop-11e767ea030cbdab3f0374f61efc3a813746fad5.tar.gz
foop-11e767ea030cbdab3f0374f61efc3a813746fad5.tar.bz2
foop-11e767ea030cbdab3f0374f61efc3a813746fad5.zip
extreme cleanup
Diffstat (limited to 'pacman-c++/pixmapitem.cpp')
-rw-r--r--pacman-c++/pixmapitem.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/pacman-c++/pixmapitem.cpp b/pacman-c++/pixmapitem.cpp
index 9c2f941..64ac594 100644
--- a/pacman-c++/pixmapitem.cpp
+++ b/pacman-c++/pixmapitem.cpp
@@ -2,43 +2,43 @@
2#include <QPainter> 2#include <QPainter>
3 3
4PixmapItem::PixmapItem(const QString &fileName, QGraphicsItem *parent) 4PixmapItem::PixmapItem(const QString &fileName, QGraphicsItem *parent)
5 : QGraphicsObject(parent), m_x(0), m_y(0) 5 : QGraphicsObject(parent), m_x(0), m_y(0)
6{ 6{
7 m_pix = ":/" + fileName; 7 m_pix = ":/" + fileName;
8 m_width = m_pix.width(); 8 m_width = m_pix.width();
9 m_height = m_pix.height(); 9 m_height = m_pix.height();
10} 10}
11 11
12PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) 12PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene)
13 : QGraphicsObject(), m_x(0), m_y(0) 13 : QGraphicsObject(), m_x(0), m_y(0)
14{ 14{
15 m_pix = ":/" + fileName; 15 m_pix = ":/" + fileName;
16 m_width = m_pix.width(); 16 m_width = m_pix.width();
17 m_height = m_pix.height(); 17 m_height = m_pix.height();
18 scene->addItem(this); 18 scene->addItem(this);
19} 19}
20 20
21void PixmapItem::setSprite(int x, int y, int width, int height) 21void PixmapItem::setSprite(int x, int y, int width, int height)
22{ 22{
23 m_x = x; 23 m_x = x;
24 m_y = y; 24 m_y = y;
25 m_width = width; 25 m_width = width;
26 m_height = height; 26 m_height = height;
27} 27}
28 28
29QSizeF PixmapItem::size() const 29QSizeF PixmapItem::size() const
30{ 30{
31 return QSizeF(m_width, m_height); 31 return QSizeF(m_width, m_height);
32} 32}
33 33
34QRectF PixmapItem::boundingRect() const 34QRectF PixmapItem::boundingRect() const
35{ 35{
36 return QRectF(QPointF(0, 0), size()); 36 return QRectF(QPointF(0, 0), size());
37} 37}
38 38
39void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) 39void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
40{ 40{
41 painter->drawPixmap(0, 0, m_pix, m_x, m_y, m_width, m_height); 41 painter->drawPixmap(0, 0, m_pix, m_x, m_y, m_width, m_height);
42} 42}
43 43
44 44