Slot triggers its own signal
<p>I'm trying to setup a <code>QTableWidget</code> that colours cells in red after a user has changed them.</p>

<pre><code>table.itemChanged.connect(flag_cell_unsaved)

@pyqtSlot(QtGui.QTableWidgetItem)
def flag_cell_unsaved(item):
    item.setForeground(Qt.red)
</code></pre>

<p>However, changing the item text to red causes the emission of another <code>itemChanged</code> signal.</p>

<p>I can hack around by disconnecting the signal during the slot function, but I feel like there should be a better/simple way to handle this.</p>