I have created a very simple application using the Qt Creator (basically a main window with a QTreeView inside + a couple rows).
It runs fine except the alternate-background-color is totally ignored.

Screen Shot 2014-04-09 at 12.53.57 am.png

Here's the code. I also tried putting the style sheet using the QT Designer but it didn't make a difference.
Can anyone tell me what's wrong?

Qt Code:
  1. const char *STYLE_SHEET =
  2. "QTreeView"
  3. "{"
  4. "color: #000000;"
  5. "background-color: #B6B6B6;"
  6. "alternate-background-color: #FFFFFF;"
  7. "selection-color: #FF0000;"
  8. "selection-background-color: #7FB3E6;"
  9. "}";
  10. int main(int argc, char *argv[])
  11. {
  12. QApplication a(argc, argv);
  13. a.setStyleSheet(STYLE_SHEET);
  14. QStandardItem *root = m.invisibleRootItem();
  15. root->appendRow(new QStandardItem("1"));
  16. root->appendRow(new QStandardItem("2"));
  17. root->appendRow(new QStandardItem("3"));
  18. MainWindow w(&m);
  19. w.show();
  20. return a.exec();
  21. }
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. MainWindow::MainWindow(QStandardItemModel *m, QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. ui->treeView->setModel(m);
  8. ui->treeView->expandAll();
  9. }
To copy to clipboard, switch view to plain text mode 

I am using QT-5.2.1 under Mac OS X Mavericks.

Thanks!