I've run into a strange behavior when changing from Qt 4.6.3 to 4.7.0, and I'm not sure what the culprit is.

I'm only beginner-intermediate with Qt, so it's very likely some misunderstanding about how all the moving parts interact.

I have specified the following in my QSS file:
Qt Code:
  1. background-color: #FFFFFF;
  2. border-color: #C3C3C4;
  3. border-radius: 0px;
  4. border-width: 1px;
  5. padding: 0px;
  6. margin-bottom: -3px;
  7. margin-right: -3px;
  8. alternate-background-color: #EEF6FF;
  9. show-decoration-selected: 1;
  10. }
To copy to clipboard, switch view to plain text mode 

#EEF6FF is a light blue. But what I see when I run my application is a light gray for the alternating row color (the default). I DO see the correct color in the cell that contains the expansion arrow...but not in the branch area or the item cells.

I've printed out the RGB values of the alternateBase of the QPalette used in the option objects...they're all correct, no surprises there... Indicating that my QSS file IS being used.

I can't see any locations in my application's code where I'm changing the background color. (Any OBVIOUS locations anyway...and I didn't write all of the code. And there's a lot of it.)

The basic flow from what I can tell is...we subclassed QTreeView, reimplemented drawRow (but we call the base class drawRow at the end of our code, which just does a transparent watermark across the rows). We have also subclassed QStyledItemDelegate and reimplemented paint (but even if I don't use that delegate for my view, there is no change in how the row colors are shown).

Here's where I'm fuzzy: because the BRANCH area of the QTreeView row shows the default alt background color...as well as the rest of the row (with the exception of the one cell containing the expand arrow, which shows the light blue I want)...I can't believe that there is a place where I'm manually making this problem occur. Well. I could believe it, but at present I can't find it.

Anyone seen behavior like this before? Any hints on where I should look? It did work perfectly in 4.6.3...