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:
Qt Code:
  1. class FieldBoundText : public QGraphicsTextItem
  2. {
  3. Q_OBJECT
  4. public:
  5. /*!
  6.   Class initializer,
  7.   - str: supply a string to display
  8.   */
  9. FieldBoundText(QString str, QGraphicsItem * parent = 0);
To copy to clipboard, switch view to plain text mode 
and have re-implemented the paint function for the class to add Anti-Aliasing:
Qt Code:
  1. protected:
  2. /*!
  3.   Reimplementing painter class for Antialiasing the font
  4.   */
  5. void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
To copy to clipboard, switch view to plain text mode 
Which looks like:
Qt Code:
  1. void FieldBoundText::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){
  2. painter->setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing);
  3. QGraphicsTextItem::paint(painter,option,widget);
  4. }
To copy to clipboard, switch view to plain text mode 
Implementing the code like:
Qt Code:
  1. FieldBoundText *txt = new FieldBoundText(QString("%1").arg(corner));
  2. txt->setPos(xStart,0);
  3. txt->setRotation(-45.0);
To copy to clipboard, switch view to plain text mode 
Results in the text without Anti-aliasing :
No-Anti-Aliasing.JPG

Please let me know if there is some work around for this problem?

- Yogesh Upreti