-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathSettingsPage.h
70 lines (55 loc) · 1.84 KB
/
SettingsPage.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//-----------------------------------------------------------------------------
// File: SettingsPage.h
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Esko Pekkarinen
// Date: 01.07.2014
//
// Description:
// Base class for all settings pages.
//-----------------------------------------------------------------------------
#ifndef SETTINGSPAGE_H
#define SETTINGSPAGE_H
#include <common/dialogs/propertyPageDialog/PropertyPageView.h>
#include <QSettings>
//-----------------------------------------------------------------------------
//! SettingsPage class.
//-----------------------------------------------------------------------------
class SettingsPage : public PropertyPageView
{
Q_OBJECT
public:
/*!
* Constructor.
*
* @param [in/out] settings The settings store.
*/
SettingsPage(QSettings& settings);
/*!
* Destructor.
*/
virtual ~SettingsPage() = default;
// Disable copying.
SettingsPage(SettingsPage const& rhs) = delete;
SettingsPage& operator=(SettingsPage const& rhs) = delete;
/*!
* Called when the page is to be changed and this page would be hidden.
*
* @return False, if the page change should be rejected. Otherwise true.
*/
virtual bool onPageChange();
protected:
/*!
* Returns the settings to the subclasses.
*
*/
QSettings& settings() const;
private:
//-----------------------------------------------------------------------------
// Data.
//-----------------------------------------------------------------------------
//! The settings store.
QSettings& settings_;
};
//-----------------------------------------------------------------------------
#endif // SETTINGSPAGE_H