summaryrefslogtreecommitdiffstats
path: root/tests/manual/gestures/graphicsview/imageitem.h
blob: ad0e397cccf19d1a8967ed03c716e7789abcb149 (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
30
31
32
33
34
35
36
#ifndef IMAGEITEM_H
#define IMAGEITEM_H

#include <QGraphicsItem>
#include <QImage>
#include <QPixmap>
#include <QTransform>

class ImageItem : public QGraphicsObject
{
    Q_OBJECT
public:
    ImageItem(const QImage &image);
    void setImage(const QImage &image);
    QImage image() const;
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

private:
    QImage image_;
    QPixmap pixmap_;
    QTransform transform;
};

class GestureImageItem : public ImageItem
{
    Q_OBJECT

public:
    GestureImageItem(const QImage &image);

protected:
    bool event(QEvent *event);
};

#endif // IMAGEITEM_H