1

I need to set delegate for QTreeWidget header or make it working with HTML tags using other ways.

I set a delegate for QTreeWidget items using

ui->tree->setItemDelegate(delegate);

and it works.

But setting a delegate to the header does not work :

ui->tree->header()->setItemDelegate(delegate);
VMai
  • 10,156
  • 9
  • 25
  • 34
Ufx
  • 2,595
  • 12
  • 44
  • 83

1 Answers1

2

It won't work and it's documented here http://qt-project.org/doc/qt-4.8/qheaderview.html#appearance

Note: Each header renders the data for each section itself, and does not rely on a delegate. As a result, calling a header's setItemDelegate() function will have no effect.

Ezee
  • 4,214
  • 1
  • 14
  • 29