summaryrefslogtreecommitdiffstats
path: root/pacman-c++/pixmapitem.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-03 17:32:48 +0200
committermanuel <manuel@mausz.at>2011-04-03 17:32:48 +0200
commit5480580d5c2fa40787a70dfdb68b52216917c58b (patch)
tree91915b6e1b9c75375d1a14f2e47a047a657c61a3 /pacman-c++/pixmapitem.cpp
parent7218df74dd2b840fd4f56de0215357b479d88e05 (diff)
downloadfoop-5480580d5c2fa40787a70dfdb68b52216917c58b.tar.gz
foop-5480580d5c2fa40787a70dfdb68b52216917c58b.tar.bz2
foop-5480580d5c2fa40787a70dfdb68b52216917c58b.zip
fix intend
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 64ac594..9c2f941 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