diff options
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveComputer.cpp | 13 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveComputer.ui | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveComputer.cpp b/desktop-widgets/tab-widgets/TabDiveComputer.cpp index b8cd32cf4..104bee0c6 100644 --- a/desktop-widgets/tab-widgets/TabDiveComputer.cpp +++ b/desktop-widgets/tab-widgets/TabDiveComputer.cpp @@ -6,12 +6,13 @@ 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); + ui.devices->setModel(&sortedModel); + ui.devices->view()->setSelectionBehavior(QAbstractItemView::SelectRows); + ui.devices->view()->setSelectionMode(QAbstractItemView::SingleSelection); + ui.devices->view()->setSortingEnabled(true); + ui.devices->view()->sortByColumn(DiveComputerModel::MODEL, Qt::AscendingOrder); + ui.devices->view()->horizontalHeader()->setStretchLastSection(true); + connect(ui.devices, &TableView::itemClicked, this, &TabDiveComputer::tableClicked); } void TabDiveComputer::updateData() diff --git a/desktop-widgets/tab-widgets/TabDiveComputer.ui b/desktop-widgets/tab-widgets/TabDiveComputer.ui index 45492a52e..af9ba60c2 100644 --- a/desktop-widgets/tab-widgets/TabDiveComputer.ui +++ b/desktop-widgets/tab-widgets/TabDiveComputer.ui @@ -12,7 +12,7 @@ </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="TableView" name="table"> + <widget class="TableView" name="devices"> <property name="title"> <string>Dive Computers</string> </property> |