- 
    Bug 
- 
    Resolution: Duplicate
- 
    P1: Critical 
- 
    None
- 
    6.2.6, 6.3.2, 6.4.0
- 
    None
The attached C++ example qtbug107543.zip overrides QStandardItemModel::headerData() to return green for the first 2 rows and red for the rest.
Steps to reproduce:
- Build the example in debug mode, note colors appear as expected
- Build the example in release mode, note colors appear randomly different. Typically, only the last row is red
Note: It appears to be fixed in 6.4.1 .
Originally reported against Qt for Python: When subclassing QAbstractTableModel; changing the background color of a header based on a condition sometimes work and sometimes not.
see attached sample model class that overrides headerData and uses Qt.BackgroundRole to change the color
it was working fine on 6.3.1
update:
I've updated the attachments to provide a working example along with screenshots of the results
631.png demonstrates the correct outcome using 6.3.1
632.png demonstrates the wrong outcome using 6.3.2
- duplicates
- 
                    QTBUG-106984 Setting background brush in QTableWidgetItem used as header item is incorrectly cached leading to incorrect display colours -         
- Closed
 
-         
- relates to
- 
                    QTBUG-31804 Setting background of QHeaderView using model's headerData() doesn't work -         
- Closed
 
-         

