summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
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
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')
-rw-r--r--qt-ui/profile/divepixmapitem.cpp7
-rw-r--r--qt-ui/profile/divepixmapitem.h1
2 files changed, 6 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);
}
diff --git a/qt-ui/profile/divepixmapitem.h b/qt-ui/profile/divepixmapitem.h
index d39f26db6..963e641e8 100644
--- a/qt-ui/profile/divepixmapitem.h
+++ b/qt-ui/profile/divepixmapitem.h
@@ -19,6 +19,7 @@ class DivePictureItem : public DivePixmapItem {
Q_PROPERTY(qreal scale WRITE setScale READ scale)
public:
DivePictureItem(QObject *parent = 0);
+ virtual ~DivePictureItem();
void setPixmap(const QPixmap& pix);
public slots:
void settingsChanged();