SavedAction Class
(Utils::SavedAction)The SavedAction class is a helper class for actions with persistent state. More...
Header: | #include <SavedAction> |
Public Functions
SavedAction(QObject *parent = nullptr) | |
void | apply(QSettings *settings) |
void | connectWidget(QWidget *widget, ApplyMode applyMode = DeferedApply) |
QVariant | defaultValue() const |
QString | dialogText() const |
void | disconnectWidget() |
virtual void | readSettings(const QSettings *settings) |
void | setDefaultValue(const QVariant &value) |
void | setDialogText(const QString &dialogText) |
void | setSettingsGroup(const QString &group) |
void | setSettingsKey(const QString &key) |
void | setSettingsKey(const QString &group, const QString &key) |
void | setValue(const QVariant &value, bool doemit = true) |
QString | settingsGroup() const |
QString | settingsKey() const |
QString | toString() const |
void | trigger(const QVariant &data) |
QVariant | value() const |
virtual void | writeSettings(QSettings *settings) |
Signals
void | valueChanged(const QVariant &newValue) |
Detailed Description
The SavedAction class is a helper class for actions with persistent state.
Member Function Documentation
SavedAction::SavedAction(QObject *parent = nullptr)
Default constructs an instance of SavedAction.
void SavedAction::apply(QSettings *settings)
void SavedAction::connectWidget(QWidget *widget, ApplyMode applyMode = DeferedApply)
QVariant SavedAction::defaultValue() const
Returns the default value to be used when the item does not exist yet in the settings.
See also setDefaultValue().
QString SavedAction::dialogText() const
See also setDialogText().
void SavedAction::disconnectWidget()
[virtual]
void SavedAction::readSettings(const QSettings *settings)
void SavedAction::setDefaultValue(const QVariant &value)
Sets the default value to be used when the item does not exist yet in the settings.
See also defaultValue().
void SavedAction::setDialogText(const QString &dialogText)
See also dialogText().
void SavedAction::setSettingsGroup(const QString &group)
Sets the group to be used when accessing the settings.
See also settingsGroup().
void SavedAction::setSettingsKey(const QString &key)
Sets the key to be used when accessing the settings.
See also settingsKey().
void SavedAction::setSettingsKey(const QString &group, const QString &key)
Sets the key and group to be used when accessing the settings.
See also settingsKey().
void SavedAction::setValue(const QVariant &value, bool doemit = true)
Sets the current value of the object. If the value changed and doemit is true, the valueChanged()
signal will be emitted.
See also value().
QString SavedAction::settingsGroup() const
Sets the key to be used when accessing the settings.
See also settingsKey().
QString SavedAction::settingsKey() const
Returns the key to be used when accessing the settings.
See also settingsKey().
QString SavedAction::toString() const
void SavedAction::trigger(const QVariant &data)
QVariant SavedAction::value() const
Returns the current value of the object.
See also setValue().