summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divepixmapitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divepixmapitem.cpp')
-rw-r--r--qt-ui/profile/divepixmapitem.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp
index a73473a1f..ce5d3c404 100644
--- a/qt-ui/profile/divepixmapitem.cpp
+++ b/qt-ui/profile/divepixmapitem.cpp
@@ -93,7 +93,9 @@ void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
button->setZValue(7);
scene()->addItem(button);
}
- button->setPos(mapToScene(0,0));
+ button->setParentItem(this);
+ button->setPos(boundingRect().width() - button->boundingRect().width() * 0.2,
+ boundingRect().height() - button->boundingRect().height() * 0.2);
button->setOpacity(0);
button->show();
Animations::show(button);
@@ -110,13 +112,17 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Animations::scaleTo(this, 0.2);
setZValue(0);
- if(button)
- button->hide();
+ if(button){
+ button->setParentItem(NULL);
+ Animations::hide(button);
+ }
}
DivePictureItem::~DivePictureItem(){
- if(button)
+ if(button){
+ button->setParentItem(NULL);
Animations::hide(button);
+ }
}
void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)