I'm sure this question has been asked before, but I couldn't find an example of it.
My model stores CAD data. It's arranged hierarchically, and besides storing data in the rows, a given item needs to be associated with row(s) in other parts of the model. What's the best way to implement this?
I was planning on using item.setData(ptr, UserRole) to store a pointer to the associated QStandardItem. The QVariant doesn't cast to a StandardItem, though. Should I subclass QStandardItem and add a method to store my pointer data? Or is there a more standardized way of doing this? I assume using QModelIndex is out of the question, as the model will change.
Thanks.
Bookmarks