Commit 01f22368 authored by Victor Poughon's avatar Victor Poughon

Merge branch 'bug-1639' into 'develop'

BUG: fix issue #1639 Update UserValue flag in QtWidgetParameterList

Closes #1639

See merge request !142
parents cdd1f85f 8117cdbc
...@@ -135,6 +135,7 @@ signals: ...@@ -135,6 +135,7 @@ signals:
/** */ /** */
void Updated(); void Updated();
void ValueChanged();
/*-[ PROTECTED SECTION ]---------------------------------------------------*/ /*-[ PROTECTED SECTION ]---------------------------------------------------*/
// //
......
...@@ -619,6 +619,11 @@ ListEditWidget ...@@ -619,6 +619,11 @@ ListEditWidget
assert( GetItemModel()!=nullptr ); assert( GetItemModel()!=nullptr );
//Notify the ParameterList that the parameter has been modified (UserValue)
// ParameterList is not available in this class, transfer the signal to WidgetParameterList
emit ValueChanged();
//Then, trigger the update the application parameters
emit Updated(); emit Updated();
} }
......
...@@ -130,13 +130,13 @@ QtWidgetModel ...@@ -130,13 +130,13 @@ QtWidgetModel
OutputProcessXMLParameter::Pointer outXMLParam = OutputProcessXMLParameter::New(); OutputProcessXMLParameter::Pointer outXMLParam = OutputProcessXMLParameter::New();
TiXmlElement* XMLAppElement = outXMLParam->ParseApplication(m_Application); TiXmlElement* XMLAppElement = outXMLParam->ParseApplication(m_Application);
//Create command line from the XML document //Create command line from the XML document
TiXmlElement * pName, *pParam; TiXmlElement * pName, *pParam;
std::ostringstream cmdLine; std::ostringstream cmdLine;
cmdLine << ""; cmdLine << "";
if(XMLAppElement) if(XMLAppElement)
{ {
pName = XMLAppElement->FirstChildElement("name"); pName = XMLAppElement->FirstChildElement("name");
...@@ -149,10 +149,10 @@ QtWidgetModel ...@@ -149,10 +149,10 @@ QtWidgetModel
//Parse application parameters //Parse application parameters
pParam = XMLAppElement->FirstChildElement("parameter"); pParam = XMLAppElement->FirstChildElement("parameter");
while(pParam) while(pParam)
{ {
//Get pareter key //Get parameter key
cmdLine << "-"; cmdLine << "-";
cmdLine << pParam->FirstChildElement("key")->GetText(); cmdLine << pParam->FirstChildElement("key")->GetText();
cmdLine << " "; cmdLine << " ";
...@@ -169,8 +169,8 @@ QtWidgetModel ...@@ -169,8 +169,8 @@ QtWidgetModel
{ {
cmdLine << pValue->GetText(); cmdLine << pValue->GetText();
cmdLine << " "; cmdLine << " ";
pValue = pValue->NextSiblingElement(); // iteration over multiple values pValue = pValue->NextSiblingElement(); // iteration over multiple values
} }
} }
else else
...@@ -188,13 +188,13 @@ QtWidgetModel ...@@ -188,13 +188,13 @@ QtWidgetModel
cmdLine << " "; cmdLine << " ";
} }
} }
pParam = pParam->NextSiblingElement(); // iteration over parameters pParam = pParam->NextSiblingElement(); // iteration over parameters
} }
//Insert a new line character at the end of the command line //Insert a new line character at the end of the command line
cmdLine << std::endl; cmdLine << std::endl;
//Report the command line string to the application logger //Report the command line string to the application logger
m_Application->GetLogger()->Write(itk::LoggerBase::INFO, cmdLine.str()); m_Application->GetLogger()->Write(itk::LoggerBase::INFO, cmdLine.str());
} }
......
...@@ -83,7 +83,13 @@ QtWidgetParameterList ...@@ -83,7 +83,13 @@ QtWidgetParameterList
setLayout( gLayout ); setLayout( gLayout );
// //
// Connections. // Connections (Update UserValue flag).
QObject::connect(
widget, &ListEditWidget::ValueChanged,
this, [=] () { emit ParameterChanged( GetParam()->GetKey() ); }
);
// Connections (Update app parameters).
QObject::connect( QObject::connect(
widget, SIGNAL( Updated() ), widget, SIGNAL( Updated() ),
this, SIGNAL( NotifyUpdate() ) this, SIGNAL( NotifyUpdate() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment