aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/divepixmapitem.cpp
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-11-29 12:40:06 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2017-12-01 09:44:34 +0100
commita1e6ac2e0942a3950f76432e8dcf3c195c281052 (patch)
tree8d37be8fc2b708aea41f04788f064435d828bae8 /profile-widget/divepixmapitem.cpp
parent8ef87e618afd1ec943c0f42a852b3b393c1e2113 (diff)
downloadsubsurface-a1e6ac2e0942a3950f76432e8dcf3c195c281052.tar.gz
Dive picture handling: Re enable multi select, improve mouse events
Some improvements for the dive picture tab and dive pictures in profile: - Bugfix mouse event in profile: Only Left-click will open picture - Bugfix mouse events in picture tab: - Re-enable context menu (Windows bug mainly) - Re-enable multi select in a nice way - Only double-left-click will open picture Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'profile-widget/divepixmapitem.cpp')
-rw-r--r--profile-widget/divepixmapitem.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/profile-widget/divepixmapitem.cpp b/profile-widget/divepixmapitem.cpp
index 1c2f18b29..c1ce3b6dd 100644
--- a/profile-widget/divepixmapitem.cpp
+++ b/profile-widget/divepixmapitem.cpp
@@ -10,6 +10,7 @@
#include <QDesktopServices>
#include <QGraphicsView>
#include <QUrl>
+#include <QGraphicsSceneMouseEvent>
DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem()
{
@@ -129,8 +130,9 @@ DivePictureItem::~DivePictureItem(){
void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
- Q_UNUSED(event);
- QDesktopServices::openUrl(QUrl::fromLocalFile(fileUrl));
+ if (event->button() == Qt::LeftButton) {
+ QDesktopServices::openUrl(QUrl::fromLocalFile(fileUrl));
+ }
}
void DivePictureItem::removePicture()