Unsolved How to change the text color of a specific row in a QTreeWidget?
What i tried:
auto model = ui.treeWidget->model()->index(0, 0); auto item = ui.treeWidget->itemFromIndex(model); auto font = item->font(0); // font. ???
Am I on the correct path? looking for help on this question.
Am I on the correct path?
No, because QFont does not specify text color.
https://doc.qt.io/qt-6/qtreewidgetitem.html#setForeground is what you're looking for...
@jsulm I'm trying to change the color of only the
setForegroundwill change the color of other things along the text?
@n34rt Depends on what is in the cell, see https://doc.qt.io/qt-6/qtreewidgetitem.html#foreground
Why don't you simply try it out to see whether it does what you want?