2014-01-14 16:59:24 +00:00
|
|
|
#include "divepixmapitem.h"
|
2014-06-08 15:43:04 +00:00
|
|
|
#include "animationfunctions.h"
|
2014-02-28 04:09:57 +00:00
|
|
|
DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem()
|
2014-01-14 16:59:24 +00:00
|
|
|
{
|
2014-01-16 04:50:56 +00:00
|
|
|
}
|
2014-06-08 15:43:04 +00:00
|
|
|
|
|
|
|
DivePictureItem::DivePictureItem(QObject *parent): DivePixmapItem(parent)
|
|
|
|
{
|
|
|
|
setAcceptsHoverEvents(true);
|
|
|
|
setScale(0.2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DivePictureItem::setPixmap(const QPixmap &pix)
|
|
|
|
{
|
|
|
|
DivePixmapItem::setPixmap(pix);
|
|
|
|
setTransformOriginPoint(boundingRect().width()/2, boundingRect().height()/2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
|
|
|
{
|
|
|
|
Animations::scaleTo(this, 1.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|
|
|
{
|
|
|
|
Animations::scaleTo(this, 0.2);
|
|
|
|
}
|