
Originally Posted by
wysota
You could get rid of those two methods you know... Each model index can contain an internalPointer() or internalId() that you can tie to your datastructure. Then you can just query for that value and access your node directly.
I really doubted it could work.
Because, when we use "createIndex" we do it like this:
self.createIndex(row, column, id(node))
self.createIndex(row, column, id(node))
To copy to clipboard, switch view to plain text mode
Where 'id' is a built in function, that return a unique number of the object (quiet like a pointer in C++). From the python documentation: This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime
But in Python, we always use reference on object, and there is (as far as I know) no way to get the object when you have his address in memory (nor his 'id').
That why I have to create my own methods.
But I've tested your method, and it work just great 
Thanks to you
Bookmarks