int flags = Qt::AlignCenter;
QImage tmpImage
(textRect.
width(), textRect.
height(),
QImage::Format_ARGB32);
tmpImg.fill(Qt::transparent);
tmpPainter.begin(&tmpImg);
tmpPainter.setBrush(Qt::NoBrush);
tmpPainter.
setPen(QColor(255,
0,
0));
tmpPainter.
drawText(QRect(0,
0, tmpImg.
width(), tmpImg.
height()), flags, myText
);
tmpPainter.end();
tmpImg
= QGLWidget::convertToGLFormat(tmpImg
);
tmpImg = tmpImg.mirrored();
glPainter->drawImage(textRect, tmpImg);
int flags = Qt::AlignCenter;
QPainter tmpPainter;
QImage tmpImage(textRect.width(), textRect.height(), QImage::Format_ARGB32);
tmpImg.fill(Qt::transparent);
tmpPainter.begin(&tmpImg);
tmpPainter.setBrush(Qt::NoBrush);
tmpPainter.setPen(QColor(255, 0, 0));
tmpPainter.drawText(QRect(0, 0, tmpImg.width(), tmpImg.height()), flags, myText);
tmpPainter.end();
tmpImg = QGLWidget::convertToGLFormat(tmpImg);
tmpImg = tmpImg.mirrored();
glPainter->drawImage(textRect, tmpImg);
To copy to clipboard, switch view to plain text mode
Bookmarks