QDateEdit: Don't emit dateChanged when calling setDate
I have a QDateEdit-dateChanged-signal connected to a model-class.
When i do change the date in the model-class from outside (open a file in my application) i call QDateEdit::setDate.
Which then emits the dateCahnged signal and calls the slot in my model-class - setting the date AGAIN (which the model-class just changed!)
Can i avoid this? For examle a QDateEdit::setDateWithoutSignals; or a possibility to temporaly disable the signals?
....or is the common way to just ignore this?
thanks,
niko
Re: QDateEdit: Don't emit dateChanged when calling setDate
Quote:
Originally Posted by niko
Can i avoid this? For examle a QDateEdit::setDateWithoutSignals; or a possibility to temporaly disable the signals?
You can use QObject::blockSignals() or just don't invoke setDate() if the date you receive is equal to the date set in QDateEdit.
Re: QDateEdit: Don't emit dateChanged when calling setDate
blockSignals is exaclty waht i was looking for, much thanks!