diff options
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveComputer.cpp')
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveComputer.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveComputer.cpp b/desktop-widgets/tab-widgets/TabDiveComputer.cpp new file mode 100644 index 000000000..b8cd32cf4 --- /dev/null +++ b/desktop-widgets/tab-widgets/TabDiveComputer.cpp @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "TabDiveComputer.h" +#include "ui_TabDiveExtraInfo.h" + +TabDiveComputer::TabDiveComputer(QWidget *parent) : TabBase(parent) +{ + ui.setupUi(this); + sortedModel.setSourceModel(&model); + ui.table->setModel(&sortedModel); + ui.table->view()->setSelectionBehavior(QAbstractItemView::SelectRows); + ui.table->view()->setSelectionMode(QAbstractItemView::SingleSelection); + ui.table->view()->setSortingEnabled(true); + ui.table->view()->sortByColumn(DiveComputerModel::MODEL, Qt::AscendingOrder); + connect(ui.table, &TableView::itemClicked, this, &TabDiveComputer::tableClicked); +} + +void TabDiveComputer::updateData() +{ +} + +void TabDiveComputer::clear() +{ +} + +void TabDiveComputer::tableClicked(const QModelIndex &index) +{ + if (!index.isValid()) + return; + + if (index.column() == DiveComputerModel::REMOVE) + sortedModel.remove(index); +} |