Skip to content

Commit

Permalink
Refs #6616. Specialized on-change function for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Mar 7, 2014
1 parent 3db8431 commit 79724a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
Expand Up @@ -274,6 +274,8 @@ private slots:
void boolChanged(QtProperty* prop);
void intChanged(QtProperty* prop);
virtual void doubleChanged(QtProperty* prop);
/// Called when one of the parameter values gets changed
void parameterChanged(QtProperty* prop);
void stringChanged(QtProperty* prop);
void filenameChanged(QtProperty* prop);
void columnChanged(QtProperty* prop);
Expand Down
19 changes: 14 additions & 5 deletions Code/Mantid/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp
Expand Up @@ -301,7 +301,7 @@ void FitPropertyBrowser::initLayout(QWidget *w)
connect(m_formulaManager,SIGNAL(propertyChanged(QtProperty*)),this,SLOT(stringChanged(QtProperty*)));
connect(m_columnManager,SIGNAL(propertyChanged(QtProperty*)),this,SLOT(columnChanged(QtProperty*)));
connect(m_vectorDoubleManager,SIGNAL(propertyChanged(QtProperty*)),this,SLOT(vectorDoubleChanged(QtProperty*)));
connect(m_parameterManager,SIGNAL(propertyChanged(QtProperty*)), this, SLOT(doubleChanged(QtProperty*)));
connect(m_parameterManager,SIGNAL(propertyChanged(QtProperty*)), this, SLOT(parameterChanged(QtProperty*)));

QVBoxLayout* layout = new QVBoxLayout(w);
QGridLayout* buttonsLayout = new QGridLayout();
Expand Down Expand Up @@ -1309,10 +1309,6 @@ void FitPropertyBrowser::doubleChanged(QtProperty* prop)
emit xRangeChanged(startX(), endX());
return;
}
else if(getHandler()->setParameter(prop))
{
return;
}
else
{// check if it is a constraint
PropertyHandler* h = getHandler()->findHandler(prop);
Expand All @@ -1338,6 +1334,19 @@ void FitPropertyBrowser::doubleChanged(QtProperty* prop)
}
}
}

/**
* Called when one of the parameter values gets changed. This could be caused either by user setting
* the value or programmatically.
* @param prop :: Parameter property which value got changed
*/
void FitPropertyBrowser::parameterChanged(QtProperty* prop)
{
if ( ! m_changeSlotsEnabled ) return;

getHandler()->setParameter(prop);
}

/** Called when a string property changed
* @param prop :: A pointer to the property
*/
Expand Down
Expand Up @@ -167,10 +167,6 @@ void MuonFitPropertyBrowser::doubleChanged(QtProperty* prop)
emit xRangeChanged(startX(), endX());
return;
}
else if(getHandler()->setParameter(prop))
{
return;
}
else
{// check if it is a constraint
MantidQt::MantidWidgets::PropertyHandler* h = getHandler()->findHandler(prop);
Expand Down

0 comments on commit 79724a9

Please sign in to comment.