BALL::VIEW::PreferencesEntry Class Reference
#include <BALL/VIEW/KERNEL/preferencesEntry.h>
List of all members.
Detailed Description
Base class for a dialog or a Preferences page. It allows to register child widgets to support reading and writing their data into a INIFile. Also restoring of a default value and the last applied value is supported. Currently the following Qt widgets are supported:
-
QLineEdit
-
QSlider
-
QSpinBox
-
QCheckBox
-
QCombobox
-
QButtonGroup
-
QLabels without text (for storing colors)
To support more sophisticated items, e.g. color tables, a base class is provided to derive from (see ExtendedPreferencesObject). This object only needs to be a QObject with the PreferencesEntry as parent. \ Furthermore this class allows to use QStackedWidget items, like e.g. in the Preferences, where all individual child widgets are then also entries in a QListView. \ \ How to use this class:
-
Derive from it.
-
Ensure, that all child widgets have a unique name (see QWidget::setObjectName)
-
Modify the constructor of the derived class:
-
Make sure that every GUI element is set to its default value.
-
Call registerWidgets_(), which automatically registeres all supported child widgets
-
Call setINIFileSectionName(String)
-
If the dialog is a page in a QStackedWidget (like in the Preferences dialog) call insertEntry(this, "Name to appear in the listview").
-
If the dialog itself has a QStackedWidget call setWidgetStack() for it and set the names of the QStackedWidget pages accordingly.
- See also:
- ModelSettings for an example
Member Typedef Documentation
Constructor & Destructor Documentation
BALL::VIEW::PreferencesEntry::PreferencesEntry |
( |
|
) |
|
virtual BALL::VIEW::PreferencesEntry::~PreferencesEntry |
( |
|
) |
[virtual] |
Member Function Documentation
virtual Position BALL::VIEW::PreferencesEntry::currentStackPage |
( |
|
) |
const [virtual] |
Get the currently shown page in the QStackedWidget.
virtual void BALL::VIEW::PreferencesEntry::dump |
( |
std::ostream & |
s = std::cout , |
|
|
Size |
depth = 0 | |
|
) |
| | const [virtual] |
Internal state dump. Dump the current internal state of this mainControl to the output ostream s with dumping depth depth.
- Parameters:
-
| s | output stream where to output the internal state |
| depth | the dumping depth |
const String& BALL::VIEW::PreferencesEntry::getINIFileSectionName |
( |
|
) |
const [inline] |
Get the name for the section in the INIFile.
StackPages& BALL::VIEW::PreferencesEntry::getStackPages |
( |
|
) |
[inline] |
Return all pages, that are to be shown in a parent QStackedWidget.
bool BALL::VIEW::PreferencesEntry::getValue_ |
( |
const QObject * |
widget, |
|
|
String & |
value | |
|
) |
| | [protected] |
void BALL::VIEW::PreferencesEntry::insertStackEntry_ |
( |
QWidget * |
, |
|
|
const String & |
name | |
|
) |
| | [protected] |
bool BALL::VIEW::PreferencesEntry::isSupported_ |
( |
QObject & |
widget |
) |
[protected] |
virtual void BALL::VIEW::PreferencesEntry::readPreferenceEntries |
( |
const INIFile & |
inifile |
) |
[virtual] |
void BALL::VIEW::PreferencesEntry::registerObject_ |
( |
QObject * |
widget |
) |
[protected] |
void BALL::VIEW::PreferencesEntry::registerWidgetForHelpSystem_ |
( |
const QWidget * |
widget, |
|
|
const String & |
url | |
|
) |
| | [protected] |
Register a widget for the internal help system
- See also:
- HelpViewer
void BALL::VIEW::PreferencesEntry::registerWidgets_ |
( |
|
) |
[protected] |
Register all supported child objects for the storing of their data. Must be called at the end of the child classes constructor.
virtual void BALL::VIEW::PreferencesEntry::restoreDefaultValues |
( |
bool |
all = false |
) |
[virtual] |
virtual void BALL::VIEW::PreferencesEntry::restoreValues |
( |
bool |
all = false |
) |
[virtual] |
Restore the values of the child widgets. Called e.g. when a user presses a Cancel button.
Reimplemented in BALL::VIEW::LightSettings.
void BALL::VIEW::PreferencesEntry::restoreValues_ |
( |
bool |
all, |
|
|
const ValueMap & |
map | |
|
) |
| | [protected] |
void BALL::VIEW::PreferencesEntry::setINIFileSectionName |
( |
const String & |
name |
) |
[inline] |
Set the name for the section in the INIFile.
bool BALL::VIEW::PreferencesEntry::setValue_ |
( |
QObject * |
widget, |
|
|
const String & |
value | |
|
) |
| | [protected] |
void BALL::VIEW::PreferencesEntry::setWidgetStack |
( |
QStackedWidget * |
stack |
) |
|
Call this method in the constructor of the derived class has its own QStackedWidget.
void BALL::VIEW::PreferencesEntry::setWidgetStackName |
( |
const String & |
name |
) |
|
If the derived class is to be shown in a QStackedWidget, call this method to set the name for its entry.
virtual void BALL::VIEW::PreferencesEntry::showStackPage |
( |
QWidget * |
widget |
) |
[virtual] |
Show the specified page in the QStackedWidget.
virtual void BALL::VIEW::PreferencesEntry::showStackPage |
( |
Position |
nr |
) |
[virtual] |
Show the specified page in the QStackedWidget.
virtual void BALL::VIEW::PreferencesEntry::storeValues |
( |
|
) |
[virtual] |
void BALL::VIEW::PreferencesEntry::unregisterObject_ |
( |
QObject * |
widget |
) |
[protected] |
virtual void BALL::VIEW::PreferencesEntry::writePreferenceEntries |
( |
INIFile & |
inifile |
) |
[virtual] |
Member Data Documentation