From e88f37d3278c74052e122457498de244b1c73d60 Mon Sep 17 00:00:00 2001 From: Sergey Starosek Date: Fri, 27 Jun 2014 16:17:33 +0400 Subject: Start external viewer on photo double-click Signed-off-by: Sergey Starosek Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qt-ui/maintab.cpp') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3df1e8a32..6f9be07b8 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -27,6 +27,7 @@ #include #include #include +#include MainTab::MainTab(QWidget *parent) : QTabWidget(parent), weightModel(new WeightModel(this)), @@ -41,6 +42,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.cylinders->setModel(cylindersModel); ui.weights->setModel(weightModel); ui.photosView->setModel(divePictureModel); + connect(ui.photosView, SIGNAL(photoDoubleClicked(QString)), this, SLOT(photoDoubleClicked(QString))); closeMessage(); QAction *action = new QAction(tr("Save"), this); @@ -1119,3 +1121,8 @@ void MainTab::escDetected() if (editMode != NONE) rejectChanges(); } + +void MainTab::photoDoubleClicked(const QString filePath) +{ + QDesktopServices::openUrl(QUrl::fromLocalFile(filePath)); +} -- cgit v1.2.3-70-g09d2