Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18214

QPainter::drawGlyphs() paints nothing with YAxis rotation transform

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.0
    • 4.8.0
    • GUI: Text handling
    • None
    • Linux/X11
    • 55446d104db77fc7994ab12352b1c08bb7b63346

    Description

      In the following test program, QPainter::drawGlyphs() draws nothing.

      test.cpp
      #include <QtGui>
      
      class TestWidget : public QWidget
      {
          Q_OBJECT
      public:
          TestWidget(QWidget* parent = 0)
              : QWidget(parent)
          {
              resize(400, 400);
          }
      
          virtual void paintEvent(QPaintEvent*)
          {
              QPainter painter(this);
      
              QTransform transform;
              transform.translate(100, 100);
              transform.rotate(50, Qt::YAxis);
              painter.setTransform(transform);
      
              // Reference drawText() in black.
              painter.setPen(Qt::black);
              painter.drawText(QPointF(0, 0), "There should be red text below.");
      
              // Failing drawGlyphs() in red.
              QTextLayout layout("There should be black text above.");
              layout.beginLayout();
              QTextLine line = layout.createLine();
              layout.endLayout();
      
              QList<QGlyphs> g = layout.glyphs();
              painter.setPen(Qt::red);
              painter.drawGlyphs(QPointF(0, 0), g.at(0));
          }
      };
      
      int main(int c, char** v)
      {
          QApplication a(c, v);
      
          TestWidget tw;
          tw.show();
      
          return a.exec();
      }
      
      #include "test.moc"
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            akling Andreas Kling (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes