Hye everybody !

I still have a problem with my proxy.
I try to change my data root (as suggested earlier) so I redefine a new index method (to use my new data root) in my proxy as this (I repeat: it's python):
Qt Code:
  1. class QtgProxyModel(QtGui.QSortFilterProxyModel):
  2. def __init__(self, model, newIndexRoot=None):
  3. super(QtGui.QSortFilterProxyModel, self).__init__()
  4.  
  5. #======= Attributes Declaration =========
  6. # We init the root of the proxy
  7. self._data = model.getNodeFromIndex(newIndexRoot) # the data root
  8. self._dObject = self._data.dDocObject # the dictonary of all children item
  9. #========================================
  10.  
  11. self.setSourceModel(model)
  12.  
  13. def index(self, row, column, parent):
  14. if not parent.isValid():
  15. parentNode = self._data
  16. else:
  17. parentNode = self._dObject[parent.internalId()]
  18.  
  19. childItem = self._dObject[id(parentNode.getChildFromNum(row))]
  20. if childItem is not None:
  21. return self.createIndex(row, column, id(childItem))
  22. else:
  23. return QtCore.QModelIndex()
To copy to clipboard, switch view to plain text mode 


But, when launch my application, it just stop. I'm running on window, and DrWatson give an unreadable report.

After debugging, the only thing I know, is that the application blow away at line 21 at the "createIndex" call.

Do I do the right thing ? If not, how should I do it (I read C++ too )?
Is it a PyQt bug ?

Thanks