Why can't I set backgroung of a QTreeWidget's header item?
Hi,
I was wondering if someone could point out why I can't set background color of a QTreeWidget's header item? I was able to set the foreground of it but cannot change the background color. Here is what I do:
myTree->setHeaderLabels(QStringList() << "blah" << "blah" << "blah";
QTreeWidgetItem *header = myTree->headerItem();
header->setForeground(1, QBrush(Qt::red)); // <<== this works!
header->setBackground(1, QBrush(Qt::green)); // <<== this does not work!
Any help is greatly appreciate.
Re: Why can't I set backgroung of a QTreeWidget's header item?
Re: Why can't I set backgroung of a QTreeWidget's header item?
Hello from the future
It took me and 3 other guys 48 hours to figure this out and luckily one of us found it.
Here it is:
QHeaderView::section {
background-color: rgb(28, 28, 28);
color: rgb(215, 215, 215);
}
Sorry for taking so long, I hope you found a workaround in the meantime.
Cheers
Cedric