Hi,
the space on top is what is needed for letters like "gjqy" under the baseline. By drawing the Text
painter.drawText(0, 200, "Gradient Text");
painter.drawText(0, 200, "Gradient Text");
To copy to clipboard, switch view to plain text mode
you set the baseline at 200. To get the Text vertical centered use
painter.drawText(0, 200+(metrics.boundingRect("m").y()/2), "Gradient Text");
painter.drawText(0, 200+(metrics.boundingRect("m").y()/2), "Gradient Text");
To copy to clipboard, switch view to plain text mode
if you have no "gy..." or use
void QPainter::drawText ( int x,
int y,
int width,
int height,
int flags,
const QString & text,
QRect * boundingRect
= 0 )
void QPainter::drawText ( int x, int y, int width, int height, int flags, const QString & text, QRect * boundingRect = 0 )
To copy to clipboard, switch view to plain text mode
with Qt::AlignHCenter.
Lykurg
Bookmarks