summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divepixmapitem.cpp
blob: b1942344e57a1c96d2714a705b4d30fc0cfbdae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "divepixmapitem.h"
#include "animationfunctions.h"
DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem()
{
}

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);
}