6.2.6, 6.3.2, 6.4.0
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
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