How can I change the font of selected QTreeView item to bold? Is it possible with stylesheet?
Printable View
How can I change the font of selected QTreeView item to bold? Is it possible with stylesheet?
This style sheet should work :
Quote:
QTreeView::item:selected {
bfont: bold;
}
you can get current item using QAbstractItemView::currentIndex and then using Qt::FontRole set a font.
yogeshgokul , it's not working. It's possible to change a colors this way, but not a font :(
spirit, thank you, it's working :)
I did it with "font", and no with "bfont" :)
Anyway I preffer to do this with stylesheet, because if not, I need to catch selection changes, and to save previous selections to change them back. But I can't find the way to do this with stylesheet.