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>
This commit is contained in:
Stefan Fuchs 2017-11-29 12:40:06 +01:00 committed by Robert C. Helling
parent 8ef87e618a
commit a1e6ac2e09
3 changed files with 28 additions and 30 deletions

View file

@ -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()