mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Emit signal on photo double-click
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b6fac74f6e
commit
d1511aa968
2 changed files with 16 additions and 1 deletions
|
@ -77,6 +77,9 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
|
||||||
break;
|
break;
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
ret = QFileInfo(key).fileName();
|
ret = QFileInfo(key).fileName();
|
||||||
|
break;
|
||||||
|
case Qt::DisplayPropertyRole:
|
||||||
|
ret = QFileInfo(key).filePath();
|
||||||
}
|
}
|
||||||
} else if (index.column() == 1) {
|
} else if (index.column() == 1) {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
|
@ -94,4 +97,11 @@ int DivePictureModel::rowCount(const QModelIndex &parent) const
|
||||||
|
|
||||||
DivePictureWidget::DivePictureWidget(QWidget *parent) : QListView(parent)
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,11 @@ class DivePictureWidget : public QListView {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DivePictureWidget(QWidget *parent);
|
DivePictureWidget(QWidget *parent);
|
||||||
|
signals:
|
||||||
|
void photoDoubleClicked(const QString filePath);
|
||||||
|
private
|
||||||
|
slots:
|
||||||
|
void doubleClicked(const QModelIndex &index);
|
||||||
};
|
};
|
||||||
|
|
||||||
class DivePictureThumbnailThread : public QThread {
|
class DivePictureThumbnailThread : public QThread {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue