It looked like we got that because of luck all of that time.
From 2bd26f32dfe430ddfd4606a69485147ea3123897 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Wed, 26 Apr 2017 17:30:08 +0200
Subject: [PATCH] Fixes saving table size

We need to make sure the model is avaliable to the table
untill it hits the destructor.

Signed-off-by: Tomaz Canabrava <[email protected]>
---
 desktop-widgets/tab-widgets/maintab.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index cade102a..066679b2 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();
-- 
2.12.2

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to