summaryrefslogtreecommitdiffstats
path: root/qt-ui/divepicturewidget.cpp
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2014-06-27 16:16:55 +0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-27 06:56:16 -0700
commitd1511aa9680d17c28ded0ee9b5472b1189edac65 (patch)
treed5e6d201860967ab6b0239a8b8b09810133f5132 /qt-ui/divepicturewidget.cpp
parentb6fac74f6edfe7a0c129676f62c6c9cb4819cea1 (diff)
downloadsubsurface-d1511aa9680d17c28ded0ee9b5472b1189edac65.tar.gz
Emit signal on photo double-click
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r--qt-ui/divepicturewidget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp
index 6849146d5..6742fc274 100644
--- a/qt-ui/divepicturewidget.cpp
+++ b/qt-ui/divepicturewidget.cpp
@@ -77,6 +77,9 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
break;
case Qt::DisplayRole:
ret = QFileInfo(key).fileName();
+ break;
+ case Qt::DisplayPropertyRole:
+ ret = QFileInfo(key).filePath();
}
} else if (index.column() == 1) {
switch (role) {
@@ -94,4 +97,11 @@ int DivePictureModel::rowCount(const QModelIndex &parent) const
DivePictureWidget::DivePictureWidget(QWidget *parent) : QListView(parent)
{
+ connect(this, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(doubleClicked(const QModelIndex &)));
+}
+
+void DivePictureWidget::doubleClicked(const QModelIndex &index)
+{
+ QString filePath = model()->data(index, Qt::DisplayPropertyRole).toString();
+ emit photoDoubleClicked(filePath);
}