[PyQt] QAbstractItemModel modelAboutToBeReset signal

Patrick Boucher pboucher at patrickboucher.com
Thu Apr 9 14:20:53 BST 2009


Thanks!

Patrick



On Thu, Apr 9, 2009 at 8:57 AM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> 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