Re: Transparent QHeaderView
If I understood your requirement correctly then you should set your header height to zero, and start your table view just below the point from where your cell area starts.
Or your transparent headers does anything which will not work in above case.
Please describe your requirement and may be some trick will work here.
Re: Transparent QHeaderView
I have a custom TableView that should have the header part.
The TableView should have transparent background: the header- as well as the cell area.
I am able to change the background color of the header part by subclassing the HeaderView class and reimplementing the paintSection method, but not to transparent.
So far I use setStyleSheet method to have transparent header part. However, I am quite sure that there is a way or some trick to do that by reimplementing the paintSection of custom HeaderView class.
Re: Transparent QHeaderView
Hi,
If you will upload some screenshot then it will help to understand what exactly you are looking for.
Thanks,
Re: Transparent QHeaderView
Quote:
However, I am quite sure that there is a way or some trick to do that by reimplementing the paintSection of custom HeaderView class.
You might try changing the QPainter::CompositionMode. I think the real problem is probably that the QHeaderView clears the section rect and fills it with the background color before it calls paintSection() so anything that might have been there from whatever is underneath has been erased.
You could try setting the QWidget property autoFillBackground to false when you create the QHeaderView instance (or retrieve it from the QTableView). This changes the default behavior (erase and fill with the background color) to do nothing. You may not need to derive a custom class from QHeaderView.