How Can I force call QHeaderView::paintSection?
-
So I have a customized paintSection implemented. I implemented in a way that always that I change a certain cell in my table view, the associated headers change the color.
The problem is that now I'm using cells with checkboxes and when I change the state of the checkbox the paintSection is not called. If I hover the headers the paintSection is called and the color is applyed, but if I only check the state of the cell, its value change, but paintSection is not called, How can I force it? -
Christian Ehrlicher Lifetime Qt Championreplied to leonardo M B on 6 Apr 2023, 17:18 last edited by
@leonardo-M-B said in How Can I force call QHeaderView::paintSection?:
that I change a certain cell in my table view, the associated headers change the color.
Connect the dataChanged() signal and emit headerDataChanged() in the slot depending on the changes or directly emit headerDataChanged().
-
@Christian-Ehrlicher Good Idea, but How Can I get the logicalFirst and logicalLast that the headerDataChanged require? I mean, dataChanged sends two QModelIndex
-
@leonardo-M-B
PasstopLeft.column()
,bottomRight.column()
on toheaderDataChanged()
?
3/4