2

I'm trying to display clickable links within a QTreeView. I've created my own QStyledItemDelegate, and I can draw text that looks like a link, but isn't clickable like a link would be.

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

Any ideas?

T. Bergemann
  • 51
  • 1
  • 5

1 Answers1

1

Have you checked out QAbstractItemView::setIndexWidget? You could create a QLabel like you said and pass it this function for the correct index.

buck
  • 1,502
  • 1
  • 20
  • 23
  • Thanks! I can't believe I missed this, I thought it was only available to QTreeWidgets. –  Aug 17 '11 at 21:17