diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.cxx b/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.cxx index b8342ffcefc4477b97e7362b50b632e6254976ab..7138c930e4af01f894c0fffedbe51a8dcfd9bdf4 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.cxx +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.cxx @@ -38,9 +38,16 @@ void QtWidgetParameterBase::CreateWidget() void QtWidgetParameterBase::UpdateGUI() { - this->DoUpdateGUI(); + // + this->DoUpdateGUI(); + + // Emit State of the Parameter to update this paramter checkbox + bool state = m_Param->GetActive(); + emit ParameterActiveStatus(state); } + + void QtWidgetParameterBase::ParameterChanged(const QString& key) { diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.h b/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.h index 9292ab5fbeaed46dc50867faa737e02cf0b50fd1..d77e24c58c0c312bf8ea98ac6df8a3bbfee20814 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.h +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterBase.h @@ -46,6 +46,9 @@ public slots: protected slots: void ParameterChanged(const QString& key); +signals: + virtual void ParameterActiveStatus(bool value); + protected: QtWidgetModel* GetModel(); diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterGroup.cxx b/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterGroup.cxx index ccff492417476461b93eff721ba07a30b31b7480..8b53478716ea0fdbe2526927d64bc1ddd0297644 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterGroup.cxx +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetParameterGroup.cxx @@ -73,9 +73,11 @@ void QtWidgetParameterGroup::DoCreateWidget() // CheckBox (col 1) QCheckBox * checkBox = new QCheckBox; - connect(checkBox, SIGNAL(clicked(bool)), specificWidget, SLOT(SetActivationState(bool))); + connect( checkBox, SIGNAL(clicked(bool)), specificWidget, SLOT(SetActivationState(bool))); connect( checkBox, SIGNAL(clicked(bool)), GetModel(), SLOT(NotifyUpdate()) ); - + connect( specificWidget, SIGNAL(ParameterActiveStatus(bool)), checkBox, SLOT(setChecked(bool))); + connect( specificWidget, SIGNAL(ParameterActiveStatus(bool)), specificWidget, SLOT(SetActivationState(bool))); + if (param->IsRoot()) { // if Mandatory make the checkbox checked and deactivated