Skip to content

What is the equivalent of QModelndex::internalPointer() in QTJambi? #215

Closed Answered by paulusel
paulusel asked this question in Q&A
Discussion options

You must be logged in to vote

Never mind. Found out that the internalId() does the job perfectly. My confusion was the result of my poor understanding.

These functions were NOT meant to provide values themselves from somewhere somehow. Rather they they return the id value you provided for createIndex() during the creation of QModeleIndex. That value helps you to identify the node in your view in your INTERNAL data structures, which you must create yourself. My mistake lies with thinking the value is some magical pointer to node I'm looking for.

In my case, I ended up creating a hashMap mapping hashCode() to object references. I supplied the hashCode() to createIndex(). When object corresponding to internalId() is requ…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@omix
Comment options

omix Dec 9, 2024
Maintainer

Answer selected by omix
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants