[resolved] How to display a string in different font size
-
Hi, I want to display a string in QGraphicsScene in different font size, eg. "100mph". I can achieve that by putting each piece in a different string. For simplicity, is there any way to display it in a single string?
Thanks.
Hi @stuartx,
You can use QGraphicsTextItem and add it toQGraphicsScene
. It has setHtml wherein you can set the text in HTML format way. So,QGraphicsTextItem *txt = new QGraphicsTextItem; txt->setHtml("<font size=\"6\">100</font><I>mph</I>"); scene->addItem(txt);