summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2014-03-11 18:31:00 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-12 12:12:13 -0700
commit5b3dab719e44f5c20304ed48c5df35f8e115c28b (patch)
tree11ab6f17ef262e6938fe24a81640189b8267ad02 /qt-ui/mainwindow.h
parent4abe9d5c8b99049c775f3ca9dbd66dbafea6f98c (diff)
downloadsubsurface-5b3dab719e44f5c20304ed48c5df35f8e115c28b.tar.gz
MainWindow: maintain one window instance of the yearly statistics
This is a bit tricky because we are using a plain widget for a window and don't have a class for it (req. more source files). Also for the table model to update we need to create a new YearlyStatisticsModel instance each time. At least, in that regard we can re-create the model each time refreshDisplay() is called. This patch adds a couple of private variables that are used to manage the memory of the yearly statistics model and window and also close that same window on MainWindow::closeEvent(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.h')
-rw-r--r--qt-ui/mainwindow.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 94655e516..8244d0a0f 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -156,6 +156,8 @@ private:
QAction *actionNextDive;
QAction *actionPreviousDive;
UserManual *helpView;
+ QTreeView *yearlyStats;
+ QAbstractItemModel *yearlyStatsModel;
CurrentState state;
QString filter();
static MainWindow *m_Instance;