2014-01-14 16:59:24 +00:00
|
|
|
#ifndef DIVEPIXMAPITEM_H
|
|
|
|
#define DIVEPIXMAPITEM_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QGraphicsPixmapItem>
|
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
class DivePixmapItem : public QObject, public QGraphicsPixmapItem {
|
2014-01-14 16:59:24 +00: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-28 04:09:57 +00:00
|
|
|
DivePixmapItem(QObject *parent = 0);
|
2014-01-14 16:59:24 +00:00
|
|
|
};
|
|
|
|
|
2014-06-08 15:43:04 +00:00
|
|
|
class DivePictureItem : public DivePixmapItem {
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(qreal scale WRITE setScale READ scale)
|
|
|
|
public:
|
2014-06-27 21:00:42 +00:00
|
|
|
DivePictureItem(int row, QObject *parent = 0);
|
2014-06-08 15:43:04 +00:00
|
|
|
void setPixmap(const QPixmap& pix);
|
|
|
|
protected:
|
|
|
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
|
|
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
2014-06-27 21:00:42 +00:00
|
|
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
|
|
private:
|
|
|
|
int rowOnModel;
|
2014-06-08 15:43:04 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEPIXMAPITEM_H
|