异常安全包裹器围绕
blockSignals(). 更多 …
QSignalBlockercan 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.{ const QSignalBlocker blocker(someQObject); // no signals here }is thus equivalent to
const bool wasBlocked = someQObject->blockSignals(true); // no signals here someQObject->blockSignals(wasBlocked);except the code using
QSignalBlockeris safe in the face of exceptions.另请参阅
QMutexLockerQEventLoopLocker
QSignalBlocker
(
o
)
¶
QSignalBlocker(o)
- param o
Constructor. Calls
object
->blockSignals(true).
PySide2.QtCore.QSignalBlocker.
reblock
(
)
¶
重新阻塞之后信号,基于先前
unblock()
.
The numbers of and
unblock()
calls are not counted, so every undoes any number of
unblock()
调用。
PySide2.QtCore.QSignalBlocker.
unblock
(
)
¶
Temporarily restores the
signalsBlocked()
state to what it was before this QSignaBlocker’s constructor ran. To undo, use
reblock()
.
The numbers of
reblock()
and calls are not counted, so every undoes any number of
reblock()
调用。