diff options
| author | manuel <manuel@mausz.at> | 2011-04-03 16:28:52 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-03 16:28:52 +0200 |
| commit | 818383fec4f220a2410177b58518797e81d8eab3 (patch) | |
| tree | 695236d9cec1c9fda09a22ec6df0cc0cd2298cc5 /pacman-c++/pixmapitem.h | |
| parent | c3abe9924ffa2b223988cbfc206abcd88c5d4094 (diff) | |
| download | foop-818383fec4f220a2410177b58518797e81d8eab3.tar.gz foop-818383fec4f220a2410177b58518797e81d8eab3.tar.bz2 foop-818383fec4f220a2410177b58518797e81d8eab3.zip | |
basic pacman qt setup
Diffstat (limited to 'pacman-c++/pixmapitem.h')
| -rw-r--r-- | pacman-c++/pixmapitem.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pacman-c++/pixmapitem.h b/pacman-c++/pixmapitem.h new file mode 100644 index 0000000..4ea3748 --- /dev/null +++ b/pacman-c++/pixmapitem.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #ifndef __PIXMAPITEM__H__ | ||
| 2 | #define __PIXMAPITEM__H__ | ||
| 3 | |||
| 4 | #include <QtGui/QGraphicsObject> | ||
| 5 | #include <QtGui/QGraphicsScene> | ||
| 6 | |||
| 7 | class PixmapItem : public QGraphicsObject | ||
| 8 | { | ||
| 9 | public: | ||
| 10 | PixmapItem(const QString &fileName, QGraphicsItem *parent = 0); | ||
| 11 | PixmapItem(const QString &fileName, QGraphicsScene *scene); | ||
| 12 | void setSprite(int x, int y, int width, int height); | ||
| 13 | QSizeF size() const; | ||
| 14 | QRectF boundingRect() const; | ||
| 15 | void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); | ||
| 16 | private: | ||
| 17 | QPixmap m_pix; | ||
| 18 | int m_x, m_y; | ||
| 19 | int m_width, m_height; | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||
