1

I've managed to add an image to left of items in a QTreeView by returning the image during an overloaded QStandardItemModel::data() with role == Qt::DecorationRole. (This post was helpful for that: Display an icon before text in a QTreeView)

So by default, QTreeView shows the text for the item to the right of the image. How can I make it show the text for the item above the image - next to the expander arrow, instead?

Thanks!

Community
  • 1
  • 1
Brian
  • 21
  • 3
  • Derive a class from `QItemDelegate`, override `paint` method to taste. Feed the delegate to the view via `QTreeView::setItemDelegate` – Igor Tandetnik Jun 05 '15 at 04:46

0 Answers0