[PyQt] QAbstractItemModel modelAboutToBeReset signal

Phil Thompson phil at riverbankcomputing.com
Thu Apr 9 13:57:00 BST 2009


On Wed, 8 Apr 2009 11:55:39 -0400, Patrick Boucher
<pboucher at patrickboucher.com> wrote:
> Hi all,
> 
> I've subclassed QAbstractItemModel and overloaded reset to be:
> 
>     def reset(self):
>         self.modelAboutToBeReset.emit()
>         self._loadPeople()
>         self.modelReset.emit()
> 
> and I get errors pertaining to missing attributes modelAboutToBeReset
> and modelReset. Do I have something wrong with the new syntax for
> emitting signals or is this a known thing or a bug? I'm using latest
> snapshots of sip and pyqt.
> 
> The pre-4.5 version of the code works fine:
> 
>     def reset(self):
>         self.emit(QtCore.SIGNAL('modelAboutToBeReset()'))
>         self._loadPeople()
>         self.emit(QtCore.SIGNAL('modelReset()'))

Should be fixed in tonight's PyQt snapshot.

Phil


More information about the PyQt mailing list