Basically, I'm trying to create a custom view that displays a hierarchy of data in a tree format. I am already using a separate software library to calculate the coordinates of each node and it's connecting lines, so I have all the positioning data I need.
We considering doing this using a QGraphicsScene at first, but each node needs to represent an item in a QStandardItemModel, and so the 2D approach simply won't work for us. Therefore, I have relegated to subclassing QAbstractItemView to obtain this functionality.
I am pretty close to getting it functional--I can draw the lines by overriding paintEvent(), but I can't seem to get all the nodes to render. Only the last leaf node in the model seems to display, even though I have verified that each node has the correct positioning data. I have even tried calling visualRect() manually on each item in the model, and still no luck.
Thanks again for the help!






Reply With Quote
Bookmarks