Hello,

I have a QDialog which contains several widgets. The QDialog is used to display the various properties of a member object of type MyObject.

The QDialog is modeless and can be udated on the fly with a new object using:
Qt Code:
  1. void MyDialog::SetMyObject(MyObject* i_pObject)
  2. {
  3. if (m_pObject != i_pObject)
  4. {
  5. m_pObject = i_pObject;
  6.  
  7. ModelToUI();
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 

The ModelToUI() function will update every widgets according to the content of m_pObject:
Qt Code:
  1. void MyDialog::ModelToUI()
  2. {
  3. if (m_pObject!= NULL)
  4. {
  5. m_pObjectNameEdit->setText(m_pObject->GetName());
  6. [....]
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 
This is where I am running into a problem, every time the ModelToUI() function is called and setText() is called, it will also launch textChanged signal which I have connected. Then, it will do a bunch of processing for every widgets.

This is what I am trying to avoid. I am aware of the :
Qt Code:
  1. m_pObjectNameEdit->blockSignals(true);
  2. m_pObjectNameEdit->setText(m_pObject->GetName());
  3. m_pObjectNameEdit->blockSignals(false);
To copy to clipboard, switch view to plain text mode 
But I was wondering if there was a way to block ALL signals for every children widgets contained in a dialog without having to use blockSignals for every single on of them. Something I could use in SetMyObject() function just before and after the ModelToUI() call.

I am also aware that in this particular case connecting textEdited instead of textChanged would solve the problem, but I also have a bunch of QRadioButton and QSpinBox widgets.

Any help would be appreciated, thank you!