QSignalBlocker can be used wherever you would otherwise use a pair of calls to blockSignals(). It blocks signals in its constructor and in the destructor it resets the state to what it was before the constructor ran.
blocker = QSignalBlocker(someQObject) # no signals here
is thus equivalent to
wasBlocked = someQObject.blockSignals(True) # no signals here someQObject.blockSignals(wasBlocked)
except the code using
QSignalBlocker is safe in the face of exceptions.
- class PySide6.QtCore.QSignalBlocker(o)¶
- PySide6.QtCore.QSignalBlocker.__exit__(arg__1, arg__2, arg__3)¶
arg__1 – object
arg__2 – object
arg__3 – object
Re-blocks signals after a previous
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.