diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2017-04-26 17:30:08 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-26 17:45:34 +0200 |
commit | 7aac3852c1cdb2a877067a46e94573bba1288f9e (patch) | |
tree | 83a391c9fee0a55b1c39a0d075e5dac50fcfa372 /desktop-widgets/tab-widgets | |
parent | c4d6055e4a9d6b29da99fd8cdf9670b36f4cfcf3 (diff) | |
download | subsurface-7aac3852c1cdb2a877067a46e94573bba1288f9e.tar.gz |
Fix saving table size
We need to make sure the model is avaliable for the table
until it hits the destructor.
Fixes #347
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 6 |
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(); |