Re: rowCount() is calling for all the top level items
I report a bug in Qt bug tracker for this.
Quote:
Originally Posted by
wysota
You can hide the original header and replace it with your own instance of
QHeaderView that is not tied to the model as I understand you want your header to reflect the current view state rather than the model's data.
I want my header to be changed depends on the row I clicked (for ex: if I click on a even row (index.row()%2 == 0 ) I put one header set & for odd row I put another header set).
in this case how a customized header can help me ?
And I could not see any function for setting data (if I customize QHeaderView) rather than QHeaderView::setRootIndex(QModelIndex);
Thanks.
Re: rowCount() is calling for all the top level items
The header takes its data from headerData() method of the model. Simply provide a custom model for it. It can even be empty just make it return whatever you need from headerData().
Re: rowCount() is calling for all the top level items
Quote:
Originally Posted by
wysota
The header takes its data from headerData() method of the model. Simply provide a custom model for it. It can even be empty just make it return whatever you need from headerData().
Thanks, It did worked with the sample I provided here, need to check with my project hope will work :-)