0

I am setting a model to QComboBox on editTextChanged. While setting a model it again emits an editTextChanged signal on editTextChanged. I am using an SQL like query for filtering combobox items. pls help me

agold
  • 6,140
  • 9
  • 38
  • 54
Nishad
  • 23
  • 8

2 Answers2

2

You could disconnect the signal from the slot(s) before setting the new model, and connect it again afterwards.

agold
  • 6,140
  • 9
  • 38
  • 54
2

You can temporarily disable all signals emitted from QComboBox using blockSignals(ture);

QComboBox* combo = /* ..... */

combo->blockSignals(true);
combo->setModel(newModel);
combo->blockSignals(false);
Lahiru Chandima
  • 22,324
  • 22
  • 103
  • 179