diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-13 19:26:29 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-07 08:56:59 -0700 |
commit | 1c590783e0e67f7be124c8fe573fad51aa273d4a (patch) | |
tree | e6c722204d7a456f9be33e43e9f7947f4b1888f3 /desktop-widgets/tab-widgets | |
parent | c139c16c03200df23d2089a79fd27d3dd460f0d0 (diff) | |
download | subsurface-1c590783e0e67f7be124c8fe573fad51aa273d4a.tar.gz |
cleanup: free tab-widgets when exiting the application
This is completely irrelevant, however out of principle,
let's free the tab-widgets at the end of the application.
To do so, use Qt's object hierarchy. I'm not a fan of this
kind of memory management, but it is how it is.
Moreover, remove the explicit constructor of MainTab, since
it doesn't differ from the default constructor anyway.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 16 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 1 |
2 files changed, 6 insertions, 11 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 73ed6127b..501afaa0c 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -58,17 +58,17 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), { ui.setupUi(this); - extraWidgets << new TabDiveEquipment(); + extraWidgets << new TabDiveEquipment(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Equipment")); - extraWidgets << new TabDiveInformation(); + extraWidgets << new TabDiveInformation(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Information")); - extraWidgets << new TabDiveStatistics(); + extraWidgets << new TabDiveStatistics(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Statistics")); - extraWidgets << new TabDivePhotos(); + extraWidgets << new TabDivePhotos(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Media")); - extraWidgets << new TabDiveExtraInfo(); + extraWidgets << new TabDiveExtraInfo(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Extra Info")); - extraWidgets << new TabDiveSite(); + extraWidgets << new TabDiveSite(this); ui.tabWidget->addTab(extraWidgets.last(), tr("Dive sites")); ui.dateEdit->setDisplayFormat(prefs.date_format); @@ -178,10 +178,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.diveTripLocation->hide(); } -MainTab::~MainTab() -{ -} - void MainTab::hideMessage() { ui.diveNotesMessage->animatedHide(); diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index 9e4290371..c083554b1 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -27,7 +27,6 @@ class MainTab : public QTabWidget { Q_OBJECT public: MainTab(QWidget *parent = 0); - ~MainTab(); void clearTabs(); void reload(); void initialUiSetup(); |