mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Open picture manager when clicking on the picture at the profile
This patch makes the click on pic == open picture browser works also on the profile instead of only on the list view.. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
259b73335f
commit
3f98f024e4
4 changed files with 18 additions and 7 deletions
|
@ -1,21 +1,25 @@
|
|||
#include "divepixmapitem.h"
|
||||
#include "animationfunctions.h"
|
||||
#include <divepicturewidget.h>
|
||||
|
||||
#include <QPen>
|
||||
#include <QBrush>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem()
|
||||
{
|
||||
}
|
||||
|
||||
DivePictureItem::DivePictureItem(QObject *parent): DivePixmapItem(parent)
|
||||
DivePictureItem::DivePictureItem(int row, QObject *parent): DivePixmapItem(parent)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
rowOnModel = row;
|
||||
setScale(0.2);
|
||||
}
|
||||
|
||||
|
@ -56,3 +60,9 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||
Animations::scaleTo(this, 0.2);
|
||||
this->setZValue(0);
|
||||
}
|
||||
|
||||
void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QString filePath = DivePictureModel::instance()->index(rowOnModel,0).data(Qt::ToolTipRole).toString();
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue