The Python Oracle

Suppress PyQt event temporarily?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5 Looping

--

Chapters
00:00 Question
00:27 Accepted answer (Score 8)
01:08 Thank you

--

Full question
https://stackoverflow.com/questions/7323...

Accepted answer links:
http://doc.qt.nokia.com/stable/qobject.h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pyqt #qtreewidget

#avk47



ACCEPTED ANSWER

Score 8


You can set blocking of signals using QObject::blockSignals.
http://doc.qt.nokia.com/stable/qobject.html#blockSignals

bool QObject::blockSignals ( bool block )
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). If block is false, no such blocking will occur. The return value is the previous value of signalsBlocked(). Note that the destroyed() signal will be emitted even if the signals for this object have been blocked. See also signalsBlocked().