Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.2
-
None
Description
When setting a background color using stylesheet, the icons and branches will be painted over by a rectangle of this color rather than being painted on top of this background.
Example
#include <QtGui> class TreeWidget : public QTreeWidget { Q_OBJECT public: TreeWidget(QWidget *parent = 0) : QTreeWidget(parent) { QTreeWidgetItem *item = new QTreeWidgetItem(this, QStringList() << "Oak"); new QTreeWidgetItem(item, QStringList() << "Birch"); new QTreeWidgetItem(this, QStringList() << "Fir"); new QTreeWidgetItem(this, QStringList() << "Pine"); } }; #include "main.moc" int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget widget; TreeWidget box; box.setStyleSheet("QTreeWidget::branch:selected {background: green;}"); QVBoxLayout layout(&widget); layout.addWidget(&box); widget.show(); return app.exec(); }