Set the color for QFont

4.2k Views Asked by At

I have a 'QGraphicsScene' scene and am trying to use

addText(const QString &text, const QFont &font = QFont())

to add some texts to the scene. It worked. But, I tried to change the text color but could NOT find a way to set the color for 'QFont'. I did not find 'font.setColor' type method.

Any suggestion?

1

There are 1 best solutions below

2
natter1 On

In Qt the color is not part of QFont. Did you try addText()->setDefaultTextColor()?