summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divepixmapitem.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-08-06 18:05:54 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-06 18:32:28 -0700
commit68af9f0afb86b8a98d0b5029cdbf746d95627877 (patch)
tree490730aa720dd930acbc6ba95cca746d4dc3ae44 /qt-ui/profile/divepixmapitem.cpp
parentb0addb456767916935a65361338b0cd68c76eb2f (diff)
downloadsubsurface-68af9f0afb86b8a98d0b5029cdbf746d95627877.tar.gz
Delete pictures from the Widget by pressing delete
Select the picture, press delete, profit. [Dirk Hohndel: removed the stray hunk that snuck into this patch] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divepixmapitem.cpp')
-rw-r--r--qt-ui/profile/divepixmapitem.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp
index 853b95029..a73473a1f 100644
--- a/qt-ui/profile/divepixmapitem.cpp
+++ b/qt-ui/profile/divepixmapitem.cpp
@@ -114,6 +114,11 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
button->hide();
}
+DivePictureItem::~DivePictureItem(){
+ if(button)
+ Animations::hide(button);
+}
+
void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
QDesktopServices::openUrl(QUrl::fromLocalFile(fileUrl));
@@ -121,7 +126,5 @@ void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
void DivePictureItem::removePicture()
{
- Animations::hide(button);
- hide();
DivePictureModel::instance()->removePicture(fileUrl);
}