[PyKDE] Overriding protected member functions

Jeremy Sanders jeremy at jeremysanders.net
Sun Dec 31 15:35:07 GMT 2006

Is it possible to override protected member functions in PyQt classes? I 
don't seem to be able to override the rowsInserted member of QTreeView in 
PyQt4. I need to do this to automatically expand new rows inserted into 
the tree by the model, e.g.

class ExpandedTreeView(qt4.QTreeView):

     def rowsInserted(self, parent, start, end):
         qt4.QTreeView.rowsInserted(self, parent, start, end)
         print "inserted"

"inserted" is never printed when I use this class instead of QTreeView. 
Any ideas how to automatically expand new rows if I can do this?



Jeremy Sanders <jeremy at jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053

More information about the PyQt mailing list