mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-18 02:24:38 +00:00
fix bug on reset param
This commit is contained in:
parent
f67548bbc2
commit
9aec093499
@ -877,7 +877,10 @@ void MainWindow::loadMeshLabSettings()
|
||||
|
||||
if (!docElem.isNull())
|
||||
{
|
||||
currentGlobalParams.pushFromQDomElement(docElem);
|
||||
RichParameter* rp = nullptr;
|
||||
bool b = RichParameterAdapter::create(docElem, &rp);
|
||||
if (b && defaultGlobalParams.hasParameter(rp->name()))
|
||||
currentGlobalParams.pushFromQDomElement(docElem);
|
||||
}
|
||||
}
|
||||
|
||||
@ -897,6 +900,7 @@ void MainWindow::loadMeshLabSettings()
|
||||
setting.setValue(v->name(), QVariant(docstring));
|
||||
}
|
||||
}
|
||||
assert(currentGlobalParams.size() == defaultGlobalParams.size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -60,8 +60,8 @@ MeshLabSettingsDialog::MeshLabSettingsDialog(
|
||||
void MeshLabSettingsDialog::openSubDialog(QTableWidgetItem* itm)
|
||||
{
|
||||
int rprow = tw->row(itm);
|
||||
const RichParameter *defPar = defParSet.at(rprow);
|
||||
RichParameter* curPar = curParSet.at(rprow);
|
||||
const RichParameter *defPar = defParSet.findParameter(curPar->name());
|
||||
SettingDialog* setdial = new SettingDialog(*curPar,*defPar,this);
|
||||
connect(
|
||||
setdial, SIGNAL(applySettingSignal(const RichParameter&)),
|
||||
|
||||
@ -57,6 +57,13 @@ void RichParameterWidget::resetValue()
|
||||
resetWidgetValue();
|
||||
}
|
||||
|
||||
void RichParameterWidget::setValue(const Value& v)
|
||||
{
|
||||
rp->setValue(v);
|
||||
resetWidgetValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const Value& RichParameterWidget::widgetValue()
|
||||
{
|
||||
|
||||
@ -54,6 +54,7 @@ public:
|
||||
// called when the user press the 'default' button to reset the parameter values to its default.
|
||||
// It just set the parameter value and then it calls the specialized resetWidgetValue() to update also the widget.
|
||||
void resetValue();
|
||||
void setValue(const Value& v);
|
||||
// update the parameter with the current widget values and return it.
|
||||
const Value& widgetValue();
|
||||
const RichParameter& richParameter() const;
|
||||
|
||||
@ -94,7 +94,7 @@ void SettingDialog::reset()
|
||||
qDebug("resetting the value of param %s to the hardwired default", qUtf8Printable(curPar->name()));
|
||||
|
||||
assert(frame.stdfieldwidgets.size() == 1);
|
||||
frame.stdfieldwidgets.at(0)->resetValue();
|
||||
frame.stdfieldwidgets.at(0)->setValue(defPar->value());
|
||||
apply();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user