The proper way would be to use your own model and keep a pointer to the graphics item in the model index. But if you want to stick with the treewidget approach, then you can make a QMap<QTreeWidgetItem*, QGraphicsItem*> map and hold the info there.