-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDPersistentMainWindow.h
More file actions
55 lines (41 loc) · 1.75 KB
/
DPersistentMainWindow.h
File metadata and controls
55 lines (41 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef DPERSISTENTMAINWINDOW_H
#define DPERSISTENTMAINWINDOW_H
/*****************************************************************************
****************************** I N C L U D E ******************************
****************************************************************************/
#include <QMainWindow>
#include <QString>
#include <QCloseEvent>
/*****************************************************************************
*
*** class DPersistentMainWindow
*
* Window class the provides for handing persistent parameters. Derived
* classes have to override LoadParameters() and SaveParameters() to suit
* their particular needs. This class provides automatic calls on startup and
* shutdown to handle loading from the file cache warning that defaults will
* be used and prompting the user if saving is desired.
*
*****************************************************************************/
class DPersistentMainWindow : public QMainWindow
{
Q_OBJECT
using Base = QMainWindow;
public:
DPersistentMainWindow(QWidget* pParent = nullptr);
virtual ~DPersistentMainWindow();
virtual void Initialize();
protected:
QString m_strAppName;
bool m_bPersistenceEnabled;
virtual void SetupCentralWidget();
virtual void closeEvent(QCloseEvent* pEvent);
virtual QString GetParameterPath(const QString& strExt) const;
protected slots:
virtual bool LoadParameters();
virtual bool SaveParameters();
private:
DPersistentMainWindow(const DPersistentMainWindow& src);
DPersistentMainWindow& operator=(const DPersistentMainWindow& rhs);
}; // end of class DPersistentMainWindow
#endif // DPERSISTENTMAINWINDOW_H