summaryrefslogtreecommitdiffstats
path: root/tests/manual/gestures/graphicsview/imageitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/gestures/graphicsview/imageitem.h')
-rw-r--r--tests/manual/gestures/graphicsview/imageitem.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/manual/gestures/graphicsview/imageitem.h b/tests/manual/gestures/graphicsview/imageitem.h
new file mode 100644
index 0000000..ad0e397
--- /dev/null
+++ b/tests/manual/gestures/graphicsview/imageitem.h
@@ -0,0 +1,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