+ add convenience methods to PrefQuantitySpinBox class
This commit is contained in:
parent
37e9c9732f
commit
d8abb92ba5
|
@ -534,6 +534,16 @@ void PrefQuantitySpinBox::contextMenuEvent(QContextMenuEvent *event)
|
|||
delete menu;
|
||||
}
|
||||
|
||||
void PrefQuantitySpinBox::onSave()
|
||||
{
|
||||
pushToHistory();
|
||||
}
|
||||
|
||||
void PrefQuantitySpinBox::onRestore()
|
||||
{
|
||||
setToLastUsedValue();
|
||||
}
|
||||
|
||||
void PrefQuantitySpinBox::pushToHistory(const QString &valueq)
|
||||
{
|
||||
Q_D(PrefQuantitySpinBox);
|
||||
|
@ -594,7 +604,11 @@ void PrefQuantitySpinBox::setToLastUsedValue()
|
|||
void PrefQuantitySpinBox::setParamGrpPath(const QByteArray& path)
|
||||
{
|
||||
Q_D(PrefQuantitySpinBox);
|
||||
d->handle = App::GetApplication().GetParameterGroupByPath(path);
|
||||
QByteArray groupPath = path;
|
||||
if (!groupPath.startsWith("User parameter:")) {
|
||||
groupPath.prepend("User parameter:BaseApp/Preferences/");
|
||||
}
|
||||
d->handle = App::GetApplication().GetParameterGroupByPath(groupPath);
|
||||
if (d->handle.isValid())
|
||||
d->prefGrp = path;
|
||||
}
|
||||
|
|
|
@ -296,6 +296,10 @@ public:
|
|||
int historySize() const;
|
||||
/// set the value of the history size property
|
||||
void setHistorySize(int);
|
||||
/// Convenience method as offered by PrefWidget. Does the same as pushToHistory().
|
||||
void onSave();
|
||||
/// Convenience method as offered by PrefWidget. Does the same as setToLastUsedValue().
|
||||
void onRestore();
|
||||
|
||||
/** @name history and default management */
|
||||
//@{
|
||||
|
|
Loading…
Reference in New Issue
Block a user