2014-01-14 14:59:24 -02:00
|
|
|
#ifndef DIVEPIXMAPITEM_H
|
|
|
|
#define DIVEPIXMAPITEM_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QGraphicsPixmapItem>
|
|
|
|
|
2014-02-27 20:09:57 -08:00
|
|
|
class DivePixmapItem : public QObject, public QGraphicsPixmapItem {
|
2014-01-14 14:59:24 -02:00
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
|
|
|
|
Q_PROPERTY(QPointF pos WRITE setPos READ pos)
|
|
|
|
Q_PROPERTY(qreal x WRITE setX READ x)
|
|
|
|
Q_PROPERTY(qreal y WRITE setY READ y)
|
|
|
|
public:
|
2014-02-27 20:09:57 -08:00
|
|
|
DivePixmapItem(QObject *parent = 0);
|
2014-01-14 14:59:24 -02:00
|
|
|
};
|
|
|
|
|
2014-06-08 12:43:04 -03:00
|
|
|
class DivePictureItem : public DivePixmapItem {
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(qreal scale WRITE setScale READ scale)
|
|
|
|
public:
|
2014-06-27 18:00:42 -03:00
|
|
|
DivePictureItem(int row, QObject *parent = 0);
|
2014-06-08 12:43:04 -03:00
|
|
|
void setPixmap(const QPixmap& pix);
|
|
|
|
protected:
|
|
|
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
|
|
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
2014-06-27 18:00:42 -03:00
|
|
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
|
|
private:
|
|
|
|
int rowOnModel;
|
2014-06-08 12:43:04 -03:00
|
|
|
};
|
|
|
|
|
2014-02-11 19:14:46 +01:00
|
|
|
#endif // DIVEPIXMAPITEM_H
|