Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.5
-
None
-
Building 64bit.
Tested on 64-bit windows 7 and RH linux.
Description
Hi, I am writing QTreeView that is working with QAbstractItemModel. Normally, the data returned from model().data() takes highest priority, i.e. it overrides everything that is specified by style or inherited from parent controls.
However, if I apply any style to QTreeView::item (the same is true if I use QTableView), the background returned from the model is ignored.
Attached a simple example, if you run it as is, it will show a small grid with black, red, green and yellow cells.
However, if you uncomment the a.setStyleSheet(...) line, all backgrounds are gone.
Note, the style has nothing to do with background, however even if it had, IMHO the background from the model should take precedence.
Note, in my case somewhere deep in the QStyleSheet code, depending on whether the style is applied to the item, either QWindowsStyle::drawControl or baseStyle()->drawControl is called - in my case, when no style is applied, baseStyle() returns QWindowsVistaStyle. Hope it helps a bit...
Please fix (or let me know which version fixes it)...
Thanks!!!