diff options
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 7 |
1 files changed, 7 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)); +} |