1 Attachment(s)
QGraphicsText Item Rotation and antialiasing
Dear All,
I have Antialiasing problem with the rotated text in QGraphicsView. I have found some bugs regarding the same problem and I have tried the latest Qt Version (5.0.0 RC2), but the problem is still not Fixed. Does someone know a workaround?
I have the following code:
Code:
{
Q_OBJECT
public:
/*!
Class initializer,
- str: supply a string to display
*/
and have re-implemented the paint function for the class to add Anti-Aliasing:
Code:
protected:
/*!
Reimplementing painter class for Antialiasing the font
*/
Which looks like:
Code:
painter
->setRenderHints
(QPainter::Antialiasing|QPainter
::TextAntialiasing);
}
Implementing the code like:
Code:
FieldBoundText
*txt
= new FieldBoundText
(QString("%1").
arg(corner
));
txt->setPos(xStart,0);
txt->setRotation(-45.0);
Results in the text without Anti-aliasing :
Attachment 8514
Please let me know if there is some work around for this problem?
- Yogesh Upreti
Re: QGraphicsText Item Rotation and antialiasing
Re: QGraphicsText Item Rotation and antialiasing
Quote:
QGLFormat frm = wgt->format();
frm.setSamples(4);
"frm" is a copy of the widget's QGLFormat. Don't you need to call QGLWidget::setFormat() method before these changes will have any effect on the widget?
Re: QGraphicsText Item Rotation and antialiasing
Hello Jonny,
I have already Antialiasing on in my QGraphicsView
I have following on :
QPainter::Antialiasing, QPainter::TextAntialiasing, QPainter::HighQualityAntialiasing
But still no effect.
Although I am not sure what QGLFormat have to do with this??
Quote:
Originally Posted by
Jonny174
Re: QGraphicsText Item Rotation and antialiasing
Please provide a minimal compilable example reproducing the problem.