how to custom Header of QTreeWidget, use setHeaderItem & setItemWidget ?
-
wrote on 8 Aug 2016, 08:56 last edited by opengpu2 8 Aug 2016, 09:06
how to custom Header of QTreeWidget, use setHeaderItem & setItemWidget ?
i use setHeaderItem & setItemWidget, but it didnot work...
do i have to inherite a child class of QHeaderView, to customize the Header?and if i have to use this method, is it possible to work fine when multi-column, and each column use setItemWidget to set a custom QWidget? -
Hi,
Technically, there's no header for a QTreeWidgetItem. A QTreeWidgetItem is the content of a cell in a QTreeWidget.
What exactly are you trying to achieve ?
-
Hi,
Technically, there's no header for a QTreeWidgetItem. A QTreeWidgetItem is the content of a cell in a QTreeWidget.
What exactly are you trying to achieve ?
-
wrote on 8 Aug 2016, 09:52 last edited by
Hi,
I'd think the proper way would be to customize a QHeaderView.
Then QTreeView::setHeader(QHeaderView * header) to set it to your tree view. -
What do you want to have in your header views ?
-
wrote on 9 Aug 2016, 01:08 last edited by
custom QWidget, use setItemWidget to set it on QTreeWidgetItem, and then use setHeaderItem to set this QTreeWidgetItem on the header, but it didnot work...
-
Hi,
I'd think the proper way would be to customize a QHeaderView.
Then QTreeView::setHeader(QHeaderView * header) to set it to your tree view. -
That doesn't really answer the question. Can you give an example of widget you would like to have on your header view ?
In any case, you have this article here that explain how to do it for example with a QComboBox.
-
That doesn't really answer the question. Can you give an example of widget you would like to have on your header view ?
In any case, you have this article here that explain how to do it for example with a QComboBox.
-
@Radek my answer wasn't directed to you, no worries ;)
7/10