aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp7
-rw-r--r--qt-ui/maintab.h1
2 files changed, 8 insertions, 0 deletions
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 <QScrollBar>
#include <QShortcut>
#include <QMessageBox>
+#include <QDesktopServices>
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));
+}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index f20af8477..3d51f72d6 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -85,6 +85,7 @@ slots:
void updateTextLabels(bool showUnits = true);
QString trHemisphere(const char *orig);
void escDetected(void);
+ void photoDoubleClicked(const QString filePath);
private:
Ui::MainTab ui;