Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.4.3
-
None
-
5ff7b773a0f59e174001da1f0550a7f0c2b6f485
Description
Trying to set a background color for items with children in a QTreeView using style sheet using QTreeView::item:has-children does not work.
It seems that the has-children pseudo-state is not supported for QTreeView::item.
Example code:
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QDirModel model;
QTreeView tree;
tree.setModel(&model);
tree.setStyleSheet("QTreeView::item:has-children
{background: rgb(153, 204, 0);}");
// Demonstrating look and feel features
tree.setAnimated(false);
tree.setIndentation(20);
tree.setSortingEnabled(true);
tree.setWindowTitle(QObject::tr("Dir View"));
tree.resize(640, 480);
tree.show();
return app.exec();
}