From 685fe05def77b039221edf06c74af74915d536c5 Mon Sep 17 00:00:00 2001 From: Samu Laaksonen Date: Tue, 25 Sep 2012 20:00:41 +0300 Subject: Initial code commit Added some stuff for project base - tiled sources - few Qt based classes for gfx --- src/GraphicsPixmapObject.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/GraphicsPixmapObject.h (limited to 'src/GraphicsPixmapObject.h') diff --git a/src/GraphicsPixmapObject.h b/src/GraphicsPixmapObject.h new file mode 100644 index 0000000..4ca8005 --- /dev/null +++ b/src/GraphicsPixmapObject.h @@ -0,0 +1,30 @@ +#ifndef GraphicsPixmapObject_h +#define GraphicsPixmapObject_h + +#include +#include + +/** + * Used for the animation in SceneChanger. As QPropertyAnimation uses + * Qt's property system, we have to derive from QObject to use properties. + * So GraphicsPixmapObject derives from QObject and QGraphicsPixmapItem + * and publishes the opacity as a property. + */ +class GraphicsPixmapObject : public QObject, public QGraphicsPixmapItem +{ + Q_OBJECT + + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity); + Q_PROPERTY(QPointF pos READ pos WRITE setPos); + +public: + explicit GraphicsPixmapObject(const QPixmap &pixmap, + QGraphicsItem *parent = 0); + +signals: + +public slots: + +}; + +#endif // GraphicsPixmapObject_h -- cgit v1.2.3