From ce48af53646cd9e7ec762fc1ac176b3aa620b11d Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 5 May 2011 00:57:07 +0200 Subject: - refactorized the whole project and made a few subprojects - replaced tcp with enet - added connect dialog - some smaller bugfixes --- pacman-c++/common/pixmapitem.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pacman-c++/common/pixmapitem.h (limited to 'pacman-c++/common/pixmapitem.h') diff --git a/pacman-c++/common/pixmapitem.h b/pacman-c++/common/pixmapitem.h new file mode 100644 index 0000000..f57c22a --- /dev/null +++ b/pacman-c++/common/pixmapitem.h @@ -0,0 +1,32 @@ +#ifndef PIXMAPITEM__H +#define PIXMAPITEM__H + +#include +#include + +class PixmapItem + : public QGraphicsObject +{ +public: + PixmapItem(QGraphicsItem *parent = 0); + PixmapItem(const QString &fileName, QGraphicsItem *parent = 0); + PixmapItem(const QString &fileName, QGraphicsScene *scene); + PixmapItem(const QPixmap &pix, QGraphicsItem *parent = 0); + PixmapItem(const QPixmap &pix, QGraphicsScene *scene); + virtual ~PixmapItem() + {}; + + void setPixmap(const QPixmap &pix); + void setSprite(int x, int y, int width, int height); + QSizeF size() const; + QRectF boundingRect() const; + QPainterPath shape() const; + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + +private: + QPixmap m_pix; + int m_x, m_y; + int m_width, m_height; +}; + +#endif -- cgit v1.2.3