Render-artefacts when rotating a QGraphicsWidget

  • Hey,

    i wrote my own text class, but it is rendered wrong:


    Where does those artefacts come from and how can i get it right? They only appear, when i rotate the text.
    I am using a Graphicsscene and Graphicsview with OpenGL Viewport. This is my Text class:
    class Text : public QGraphicsWidget


    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *);
    QString m_Text;
    QColor m_Color;

    void pressed();

    Text::Text() : m_Color(QColor(255,255,255))

    Text::~Text() {

    void Text::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
    painter->setPen( m_Color );
    painter->drawText( boundingRect(), m_Text );

    For the rotation i used m_InformationText.setRotation(-90);
    Without the rotation it works fine!

  • Does this happen with other fonts, too?

  • Yes, changed the font in Text::paint with

    QFont sansFont("Times", 11);

    Same Problem.

  • Oh, and i have to say that this error is only here at my pc at home. At my working place it is working as it should.

  • Perhaps an OpenGl driver issues? Do you also have the artifacts if you use the raster backend?

  • It renders fine, when i use the raster renderer. But the raster renderer is a bit too slow for my application. My Animations started stuttering.

  • I have just made a Driver update. from 285 to 301 on my NVidia 560 GTX. Still have those artefacts :(

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.