mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-15 09:04:36 +00:00
fix load for meshlab settings
This commit is contained in:
parent
3b7f9ff202
commit
35cb48ad37
@ -30,6 +30,7 @@ SettingDialog::SettingDialog(
|
||||
QDialog(parent),
|
||||
frame(this),
|
||||
curPar(currentPar.clone()),
|
||||
tmpPar(currentPar.clone()),
|
||||
defPar(defaultPar.clone())
|
||||
{
|
||||
tmpParSet = RichParameterList();
|
||||
@ -67,19 +68,22 @@ SettingDialog::SettingDialog(
|
||||
|
||||
SettingDialog::~SettingDialog()
|
||||
{
|
||||
delete curPar;
|
||||
delete tmpPar;
|
||||
delete defPar;
|
||||
}
|
||||
|
||||
void SettingDialog::save()
|
||||
{
|
||||
apply();
|
||||
const RichParameter& tmppar = frame.stdfieldwidgets.at(0)->richParameter();
|
||||
delete tmpPar;
|
||||
tmpPar = curPar->clone();
|
||||
QDomDocument doc("MeshLabSettings");
|
||||
doc.appendChild(tmppar.fillToXMLDocument(doc));
|
||||
doc.appendChild(curPar->fillToXMLDocument(doc));
|
||||
QString docstring = doc.toString();
|
||||
qDebug("Writing into Settings param with name %s and content ****%s****", qUtf8Printable(tmppar.name()), qUtf8Printable(docstring));
|
||||
qDebug("Writing into Settings param with name %s and content ****%s****", qUtf8Printable(curPar->name()), qUtf8Printable(docstring));
|
||||
QSettings setting;
|
||||
setting.setValue(tmppar.name(),QVariant(docstring));
|
||||
curPar->setValue(tmppar.value());
|
||||
setting.setValue(curPar->name(),QVariant(docstring));
|
||||
}
|
||||
|
||||
void SettingDialog::apply()
|
||||
@ -101,7 +105,8 @@ void SettingDialog::reset()
|
||||
void SettingDialog::load()
|
||||
{
|
||||
assert(frame.stdfieldwidgets.size() == 1);
|
||||
frame.stdfieldwidgets.at(0)->setWidgetValue(curPar->value());
|
||||
frame.stdfieldwidgets.at(0)->setWidgetValue(tmpPar->value());
|
||||
apply();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ private:
|
||||
RichParameterList tmpParSet;
|
||||
RichParameterListFrame frame;
|
||||
RichParameter* curPar;
|
||||
RichParameter* tmpPar;
|
||||
const RichParameter* defPar;
|
||||
QPushButton* savebut;
|
||||
QPushButton* applybut;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user