QGraphicsTextItem sharpness when rotated
I'm trying to use a QGraphicsTextItem to rotate a text and write it on a QGraphicsScene. The problem is that if I rotate the text it get's blurred as you can see in this image:
http://i49.tinypic.com/9j13xw.jpg
Is it possible to get a better sharpeness on the text? Should I use another font or is the text to small to get sharp?
This is the code I'm using:
Code:
text
->setFont
(QFont( "Arial",
3,
QFont::Normal ));
text
->setDefaultTextColor
(QColor(0,
0,
0));
text->rotate(45);
scene->addItem(text);
Re: QGraphicsTextItem sharpness when rotated
Have you looked into aliasing? Try enabling it on your QGraphicsView
I just read, that QPainter::TextAntialiasing is enabled by default, so probably its already enabled in your case, too.
Yes, looking at your sample, with a big magnification, I can see that Antialiasing is enabled.
I guess you are beyond the limits of your screen-resolution then... Just make it bigger :->
HIH
Johannes
Re: QGraphicsTextItem sharpness when rotated
Thank you very much!
One question though, as you can see I set the font size to "3". I'm building for Symbian and on my Symbian device "3" is the size that works the best. But when I tried open the app in Windows "3" is very very small because of the screen resolution is much greater. The rest of my QGraphicsScene is resized can I have the same thing happen with the text so it will be larger if I have a larger screen resolution.
The same problems I have with my QLabels, setting the font with stylesheets on a QLabel to for example "3pt" looks good in Symbian but is too small with a larger screen resolution. Can I in some way make the QLabels and other widgets text scale to fit the screen resolution? Should I use something different than "pt"?
Hope you can answer my questions and thank you very much for your help!
Re: QGraphicsTextItem sharpness when rotated
I thought pt = points where device independant?
http://lists.trolltech.com/pipermail/qt-embedded-interest/2010-January/000778.html
But, I have no experience with embedded systems.
If you can't find a platform independant solution just let the user define the font size and store/load it with QSettings, with platform specific defaults ..
Joh