Hi dear list,<div><br></div><div>on windows7-64, with python32 (and also with python27) (-x86) and pyqt-4.8.5-1:</div><div><br></div><div>First of all: I'm quite new with Qt (pyqt).. and so I don't know all of it, even more specifically about the restrictions/exceptions/etc.., from far.</div>

<div><br></div><div>in a quite simple window (just a tableWidget and few buttons basically) :</div><div><br></div><div>I connected the itemChanged signal/event of the tableWidget to one of my method.  ( gui.tableWidget.itemChanged.connect(self.onCellChanged) )</div>
<div><br></div>
<div>but in this method I want to be able to eventually re-modify the value of the item (depending on some conditions)..</div><div><br></div><div>but doing so re-generate a itemChanged event..  so in that case my method was called 1 extra time that I don't want. </div>

<div><br></div><div>I used to work around that by : on begin of my method : I disconnect the event itemChanged from my method. And on exit of my method I re-connect the signal to it.</div><div><br></div><div>my question is : does it sound like all right to you ??</div>

<div><br></div><div>because with that I sometimes (but quite highly reproducible) get real crash from QtCore.. but without any valuable detail.   as far as I understood : it could be a problem because I disconnect-reconnect the event handler from within the handler itself AND ALSO, apparently, that I was also displaying a QtGui.QMessageBox  from within my method. (when I remove the display of the Qmsgbox then the crash doesn't occur anymore, never, as far I could see).</div>

<div><br></div><div><br></div><div>Now I've totally work around the problem/crash by using a bool flag that I initially set to False.</div><div>when my itemChanged event handler enters : it checks for the flag. if True -> the method directly returns. Else it sets the flag to True and the method executes normally. before returning from it I reset the flag to False. </div>

<div>So that if I change the value of the item in the method then the method will still be called 1 extra time but I notice it thx to the flag. </div><div><br></div><div>Now with that I have all what I want and that doesn't crash anymore at all like it was before.</div>
<div><br>
</div><div>but I was asking myself about why disconnect/reconnecting an event from the handler could be "risky" like I experienced..</div><div><br></div><div>thx for any comment / feeling..</div><div><br></div>
<div>regards,</div>
<div><br></div><div>Greg.</div><div><br></div>