Hello,
I'm trying to visualise a tree in Qt.
So far, all my nodes consist of simple circles and based on QGraphicsItem class. But I need to display some text over every node, how can I "attach" a QLabel to my nodes?
Thanks in advance.
Hello,
I'm trying to visualise a tree in Qt.
So far, all my nodes consist of simple circles and based on QGraphicsItem class. But I need to display some text over every node, how can I "attach" a QLabel to my nodes?
Thanks in advance.
Well, why don't you use QTreeView to view your tree ? You just have to subclass QAbstractItemModel with your own model and use it.
You can use a QGraphicsTextItem
on your nodes.
QGraphicsTextItem *nodeText = new QGraphicsTextItem("TEXT LABEL", nodeItem);