Hi, On Thursday 09 April 2009 19:35:32 TP wrote: > Here are the most important lines: > self.view = QTreeView( parent ) > self.connect( self.view, SIGNAL( "clicked(QModelIndex)" ) > , self.cellClicked ) > def cellClicked( self, qmodelindex ): > if qmodelindex.isValid(): > print qmodelindex.internalPointer() > The problem seems to be related to qmodelindex, the segfault appears when > taking internalPointer method.
I think there is a very good reason internalPointer has the name it has. It is a pointer for internal purposes, that is internal for the model so it can map indexes to the internal data structures. (And yes, that is needed for anything except simple list or table models.:) You shouldn't really access it from a view (or from a proxy-model). Actually the reason for the model-view-pattern is that you don't have to access the internal structures of the model from the view... And here is another reason this crashes: Not only don't you know which type (if any) the object pointed to is, you also don't know whether python knows about that data type (python doesn't really know about pointers). Have fun, Arnold
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
