Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.8.0
-
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"