summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/maintab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets/maintab.cpp')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index cade102a5..066679b2f 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -59,6 +59,12 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
memset(&displayed_dive, 0, sizeof(displayed_dive));
memset(&displayedTrip, 0, sizeof(displayedTrip));
+ // This makes sure we only delete the models
+ // after the destructor of the tables,
+ // this is needed to save the column sizes.
+ cylindersModel->setParent(ui.cylinders);
+ weightModel->setParent(ui.weights);
+
ui.cylinders->setModel(cylindersModel);
ui.weights->setModel(weightModel);
closeMessage();