1 Attachment(s)
QTreeView Stylesheet: alternate-background-color ignored (QT-5.2.1)
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.
Attachment 10275
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?
Code:
const char *STYLE_SHEET =
"QTreeView"
"{"
"color: #000000;"
"background-color: #B6B6B6;"
"alternate-background-color: #FFFFFF;"
"selection-color: #FF0000;"
"selection-background-color: #7FB3E6;"
"}";
int main(int argc, char *argv[])
{
a.setStyleSheet(STYLE_SHEET);
MainWindow w(&m);
w.show();
return a.exec();
}
Code:
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->treeView->setModel(m);
ui->treeView->expandAll();
}
I am using QT-5.2.1 under Mac OS X Mavericks.
Thanks!
Re: QTreeView Stylesheet: alternate-background-color ignored (QT-5.2.1)