I'm trying to change the selection behaviour in a QTreeView using a stylesheet. The show-decoration-selected property seems to have no effect.

I'm calling the following in my QMainWindow:

Qt Code:
  1. setStyleSheet(
  2. "QTreeView {"
  3. " selection-background-color: navy;"
  4. " alternate-color: white;"
  5. " alternate-background-color: rgb(240,240,240);"
  6. " show-decoration-selected: 1;"
  7. "}"
  8. );
To copy to clipboard, switch view to plain text mode 

The alternate-background-color property does have an effect, so I know that the QTreeView is using the stylesheet. But switching show-decoration-selected from 0 to 1 has no effect at all. How should the show-decoration-selected property affect a QTreeView?

I would like to have the entire row selected from the extreme left of the QTreeView to the extreme right of the QTreeView regardless of the level/depth of the item in the QTreeView. And I would like the selection-background-color to be navy and selection-color to be white.

I have had this styling working for a QTableView. Any reason why it shouldn't be possible for a QTreeView?

I'm on Windows 7 using C++ Qt 4.6.2 in Visual Studio 2008.