Hyperlinks in QTreeView

I am trying to display interactive links in a QTreeView. I created my own QStyledItemDelegate, and I can draw text that looks like a link but is not clickable as a link would be.

One of the options I'm thinking of is creating a QLabel with a link and drawing a QLabel inside the QTreeView cells. The only problem is that I cannot figure out how to add QLabels to QTreeView.

Any ideas?

+1
source share
1 answer

Have you checked QAbstractItemView :: setIndexWidget ? You can create a QLabel, as you said, and pass this function to it for the correct index.

0
source

Source: https://habr.com/ru/post/1243005/


All Articles