#include <Libs/Widgets/ctkSettingsPanel.h>
|
void | settingChanged (const QString &key, const QVariant &value) |
| Fired anytime a property is modified. More...
|
|
|
QStringList | changedSettings () const |
|
| ctkSettingsPanel (QWidget *parent=0) |
| Constructor. More...
|
|
void | registerProperty (const QString &settingKey, QObject *object, const QString &objectProperty, const char *propertySignal, const QString &settingLabel=QString(), SettingOptions options=OptionNone, QSettings *settings=0) |
|
Q_INVOKABLE void | registerProperty (const QString &settingKey, QObject *object, const QString &objectProperty, const QByteArray &propertySignal, const QString &settingLabel=QString(), SettingOptions options=OptionNone, QSettings *settings=0) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
|
void | setSetting (const QString &key, const QVariant &newVal) |
|
void | setSettings (QSettings *settings) |
|
QString | settingLabel (const QString &settingKey) const |
| Return the label associated to a setting. More...
|
|
SettingOptions | settingOptions (const QString &settingKey) const |
| Return the options associated to a setting. More...
|
|
QSettings * | settings () const |
|
virtual | ~ctkSettingsPanel () |
| Destructor. More...
|
|
|
QScopedPointer< ctkSettingsPanelPrivate > | d_ptr |
|
Definition at line 35 of file ctkSettingsPanel.h.
◆ Superclass
◆ SettingOption
Enumerator |
---|
OptionNone | |
OptionRequireRestart | |
OptionAll_Mask | |
Definition at line 56 of file ctkSettingsPanel.h.
◆ ctkSettingsPanel()
ctkSettingsPanel::ctkSettingsPanel |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
◆ ~ctkSettingsPanel()
virtual ctkSettingsPanel::~ctkSettingsPanel |
( |
| ) |
|
|
virtual |
◆ applySettings
virtual void ctkSettingsPanel::applySettings |
( |
| ) |
|
|
virtualslot |
◆ changedSettings()
QStringList ctkSettingsPanel::changedSettings |
( |
| ) |
const |
Return the list of settings keys that have been modified and are not yet applied.
◆ defaultPropertyValue()
QVariant ctkSettingsPanel::defaultPropertyValue |
( |
const QString & |
key | ) |
const |
|
protected |
Return the default value of a property identified by its settings key
- See also
- registerProperty();
◆ previousPropertyValue()
QVariant ctkSettingsPanel::previousPropertyValue |
( |
const QString & |
key | ) |
const |
|
protected |
Return the previous value of a property identified by its settings key
- See also
- registerProperty();
◆ propertyValue()
QVariant ctkSettingsPanel::propertyValue |
( |
const QString & |
key | ) |
const |
|
protected |
◆ registerProperty() [1/2]
void ctkSettingsPanel::registerProperty |
( |
const QString & |
settingKey, |
|
|
QObject * |
object, |
|
|
const QString & |
objectProperty, |
|
|
const char * |
propertySignal, |
|
|
const QString & |
settingLabel = QString() , |
|
|
SettingOptions |
options = OptionNone , |
|
|
QSettings * |
settings = 0 |
|
) |
| |
Add an entry into the settings uniquely defined by the key name and the current value of the property. The property is then synchronized with the settings by observing the signal notification. Anytime the property is modified (the signal signal is fired), its value associated to key is updated in the settings. signal is typically the value under NOTIFY in Q_PROPERTY. The current value of the property is later used when restoreDefaultSettings() is called. If you want to register the logical complement of a boolean property you can use ctkBooleanMapper: panel->registerProperty("unchecked", new ctkBooleanMapper(checkBox, "checked", SIGNAL(toggled(bool))), "complement", SIGNAL(complementChanged(bool)));
By default, property are associated with the general settings set using setSettings(QSettings*) or ctkSettingsDialog::setSettings(QSettings*). Note that it also possible to associate a specific settings for any given settingKey.
- See also
- Q_PROPERTY(),
-
ctkBooleanMapper
◆ registerProperty() [2/2]
Q_INVOKABLE void ctkSettingsPanel::registerProperty |
( |
const QString & |
settingKey, |
|
|
QObject * |
object, |
|
|
const QString & |
objectProperty, |
|
|
const QByteArray & |
propertySignal, |
|
|
const QString & |
settingLabel = QString() , |
|
|
SettingOptions |
options = OptionNone , |
|
|
QSettings * |
settings = 0 |
|
) |
| |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ reloadSettings
virtual void ctkSettingsPanel::reloadSettings |
( |
| ) |
|
|
virtualslot |
◆ resetSettings
virtual void ctkSettingsPanel::resetSettings |
( |
| ) |
|
|
virtualslot |
Restore all the properties with their values when applySettings() was called last (or their original values if applySettings was never called).
◆ restoreDefaultSettings
virtual void ctkSettingsPanel::restoreDefaultSettings |
( |
| ) |
|
|
virtualslot |
Restore all the properties with their original values; the current values of the properties when they were registered using registerProperty().
◆ setSetting()
void ctkSettingsPanel::setSetting |
( |
const QString & |
key, |
|
|
const QVariant & |
newVal |
|
) |
| |
Set the setting to the property defined by the key. The old value can be restored using resetSettings()
◆ setSettings()
void ctkSettingsPanel::setSettings |
( |
QSettings * |
settings | ) |
|
◆ settingChanged
void ctkSettingsPanel::settingChanged |
( |
const QString & |
key, |
|
|
const QVariant & |
value |
|
) |
| |
|
signal |
Fired anytime a property is modified.
◆ settingLabel()
QString ctkSettingsPanel::settingLabel |
( |
const QString & |
settingKey | ) |
const |
Return the label associated to a setting.
◆ settingOptions()
SettingOptions ctkSettingsPanel::settingOptions |
( |
const QString & |
settingKey | ) |
const |
Return the options associated to a setting.
◆ settings()
QSettings* ctkSettingsPanel::settings |
( |
| ) |
const |
◆ updateSetting
void ctkSettingsPanel::updateSetting |
( |
const QString & |
key | ) |
|
|
protectedslot |
◆ d_ptr
QScopedPointer<ctkSettingsPanelPrivate> ctkSettingsPanel::d_ptr |
|
protected |
◆ settings
QSettings* ctkSettingsPanel::settings |
|
readwrite |
The documentation for this class was generated from the following file: