How can I change the font of selected QTreeView item to bold? Is it possible with stylesheet?
How can I change the font of selected QTreeView item to bold? Is it possible with stylesheet?
This style sheet should work :
QTreeView::item:selected {
bfont: bold;
}
dima1000 (11th October 2009)
you can get current item using QAbstractItemView::currentIndex and then using Qt::FontRole set a font.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
dima1000 (11th October 2009)
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.
Bookmarks