diff options
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 671225b86..ffda54769 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -61,6 +61,7 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : ui.downloadedView->setColumnWidth(0, startingWidth * 20); ui.downloadedView->setColumnWidth(1, startingWidth * 15); ui.downloadedView->setColumnWidth(2, startingWidth * 10); + connect(ui.downloadedView, SIGNAL(clicked(QModelIndex)), diveImportedModel, SLOT(changeSelected(QModelIndex))); QRect mainGeometry = parent->geometry(); int width = mainGeometry.width() * 0.8; int height = mainGeometry.height() * 0.8; @@ -591,6 +592,12 @@ bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value, return true; } +void DiveImportedModel::changeSelected(QModelIndex index) +{ + checkStates[index.row()] = !checkStates[index.row()]; + dataChanged(index, index, QVector<int>() << Qt::CheckStateRole); +} + Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const { if (index.column() != 0) |