blob: e576d774ac55cfda683af80ad144bc6314e43c05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef PIXMAPITEM__H
#define PIXMAPITEM__H
#include <QtGui/QGraphicsObject>
#include <QtGui/QGraphicsScene>
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;
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
private:
QPixmap m_pix;
int m_x, m_y;
int m_width, m_height;
};
#endif
|