How Can I force call QHeaderView::paintSection?
-
wrote on 6 Apr 2023, 16:48 last edited by leonardo M B 4 Jun 2023, 16:49
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? -
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?@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().
-
@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().
wrote on 6 Apr 2023, 17:37 last edited by@Christian-Ehrlicher Good Idea, but How Can I get the logicalFirst and logicalLast that the headerDataChanged require? I mean, dataChanged sends two QModelIndex
-
@Christian-Ehrlicher Good Idea, but How Can I get the logicalFirst and logicalLast that the headerDataChanged require? I mean, dataChanged sends two QModelIndex
wrote on 6 Apr 2023, 18:01 last edited by@leonardo-M-B
PasstopLeft.column()
,bottomRight.column()
on toheaderDataChanged()
?
1/4