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;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -33,9 +33,14 @@ class DivePictureWidget : public QListView {
|
|||
Q_OBJECT
|
||||
public:
|
||||
DivePictureWidget(QWidget *parent);
|
||||
signals:
|
||||
void photoDoubleClicked(const QString filePath);
|
||||
private
|
||||
slots:
|
||||
void doubleClicked(const QModelIndex &index);
|
||||
};
|
||||
|
||||
class DivePictureThumbnailThread : public QThread {
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue