Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Render-artefacts when rotating a QGraphicsWidget
Forum Updated to NodeBB v4.3 + New Features

Render-artefacts when rotating a QGraphicsWidget

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zweistein
    wrote on last edited by
    #1

    Hey,

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

    !http://data.whosme.de/bug.png(bug.png)!

    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
    {
    Q_OBJECT

    public:
    Text();
    ~Text();

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

    signals:
    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!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      Does this happen with other fonts, too?

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zweistein
        wrote on last edited by
        #3

        Yes, changed the font in Text::paint with

        QFont sansFont("Times", 11);
        painter->setFont(sansFont);

        Same Problem.

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zweistein
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zweistein
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zweistein
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved