PDA

View Full Version : Text with weird formatting in a ggraphicsview



ClintEastwood
20th April 2014, 20:35
Hello,

I'm trying to display a text in a qgraphicsview but it appears with a very weird formatting:
10292

The text that appears is "Mission". The "i" chars appear very close to the next characters. I would like to show it properly and to reduce the space between the letters. I have tried it modifying the strech property of the qfont object but nothing changes. I would like to reduce the size of the text even more too, but I think the point size has been already set to the minimum value...

This is my code:




painter->scale(1, -1);
QFont font = painter->font();
font.setPointSize(2);
painter->setFont(font);
painter->drawText(center.x() + 1, 0, QString::number(vehicleId));
font.setPointSize(1);
font.setStretch(50);
painter->setFont(font);
painter->drawText(center.x() - 5, center.y() + 3, "(" + state + ")");
painter->scale(1, 1);



Can anyone help me?

Thanks in advance