PDA

View Full Version : pyqt5 - how to use QSignalBlocker class?



chmedly
13th October 2017, 05:01
I had the assumption that:


QtCore.QSignalBlocker(mywidget.setValue(somevalue) )

Would be somewhat equivalent to:


mywidget.blockSignals(True)
mywidget.setValue(somevalue)
mywidget.blockSignals(False)

But, I've found that the latter actually does block the signals while the former appears to do "nothing".

I must be missing something. Anyone have some insight?