Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
PropertyPage.h
Go to the documentation of this file.
1#pragma once
2#include <QSettings>
3#include <QWidget>
4#include <misc/global.h>
5
6namespace sf
7{
8
9// Forward declaration.
11
15class _MISC_CLASS PropertyPage : public QWidget
16{
17 Q_OBJECT
18
19 public:
24 explicit PropertyPage(QWidget* parent);
25
30 virtual QIcon getPageIcon() const;
31
35 void setPageIcon(const QIcon&);
36
41 virtual QString getPageName() const;
42
46 void setPageName(const QString&);
47
51 virtual QString getPageDescription() const;
52
56 void setPageDescription(const QString&);
61 virtual void updatePage();
62
67 virtual bool isPageModified() const;
68
73 virtual bool canApplyPage() const;
74
78 virtual void applyPage();
79
86 virtual void afterPageApply(bool was_modified);
87
91 PropertySheetDialog* getSheet();
92
97 virtual void stateSaveRestore(QSettings& settings, bool save);
98
99 protected:
105 virtual QWidgetList connectControls();
106
111
115 QString _name;
116
121
125 QIcon _icon;
126
128};
129
131{
132 return _sheet;
133}
134
135}// namespace sf
Widget to create a page in a PropertySheet dialog.
Definition PropertyPage.h:16
QIcon _icon
Holds the description of the property page for when getPageIcon() is not overridden.
Definition PropertyPage.h:125
void setPageDescription(const QString &)
Sets the description for hinting of the page in the list view.
void setPageIcon(const QIcon &)
Sets the icon of the page for displaying in the list view.
virtual void updatePage()
Updates the control widgets of the page. This method is called to initialize the control widgets.
friend PropertySheetDialog
Definition PropertyPage.h:127
virtual void applyPage()
Applies the changes made in this page.
PropertySheetDialog * _sheet
Holds the sheet it is part of and also its parent.
Definition PropertyPage.h:110
void setPageName(const QString &)
Sets the page name icon of the page for displaying in the list view.
PropertyPage(QWidget *parent)
Constructor.
virtual QString getPageDescription() const
Gets the description for hinting of the page in the list view.
QString _name
Holds the name of the property page for when getPageName() is not overridden.
Definition PropertyPage.h:115
virtual void stateSaveRestore(QSettings &settings, bool save)
Called by sheet to save the state of the page. A call to QSettings::beginGroup() is not needed since ...
virtual QWidgetList connectControls()
Connects all known controls change signals to a handler which enables or disables buttons....
virtual QIcon getPageIcon() const
Gets the icon of the page for displaying in the list view. Default it returns the sf::Resource settin...
QString _description
Holds the description of the property page for when getPageDescription() is not overridden.
Definition PropertyPage.h:120
virtual QString getPageName() const
Gets the name of the page for displaying in the list view. When reimplemented the QObject's name is r...
virtual bool canApplyPage() const
Allows validation of the changes made per page. First page which return false is selected.
PropertySheetDialog * getSheet()
Gets the parent sheet of this page. (also the parent but cast.)
Definition PropertyPage.h:130
virtual void afterPageApply(bool was_modified)
Called when all pages are applied. Method can be overridden by a derived class to update control widg...
virtual bool isPageModified() const
Gets the modified/changed status of the page.
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
class _MISC_CLASS PropertySheetDialog
Definition gen/PropertySheetDialog.h:18