mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4abe9d5c8b
commit
5b3dab719e
2 changed files with 34 additions and 9 deletions
|
@ -156,6 +156,8 @@ private:
|
|||
QAction *actionNextDive;
|
||||
QAction *actionPreviousDive;
|
||||
UserManual *helpView;
|
||||
QTreeView *yearlyStats;
|
||||
QAbstractItemModel *yearlyStatsModel;
|
||||
CurrentState state;
|
||||
QString filter();
|
||||
static MainWindow *m_Instance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue