jiveaxe
9th November 2007, 17:27
If I have this code:
...
QPainter *painter = new QPainter(this);
painter->setPen(Qt::white);
QAbstractTextDocumentLayout::PaintContext context;
QTextDocument doc;
doc.setTextWidth(220);
doc.setHtml(text);
doc.documentLayout()->draw(painter, context);
the text is drawn in black instead of white? Only if i write:
doc.setHtml("<font color=\"white\">" + text + "</font>");
it works.
Regards
...
QPainter *painter = new QPainter(this);
painter->setPen(Qt::white);
QAbstractTextDocumentLayout::PaintContext context;
QTextDocument doc;
doc.setTextWidth(220);
doc.setHtml(text);
doc.documentLayout()->draw(painter, context);
the text is drawn in black instead of white? Only if i write:
doc.setHtml("<font color=\"white\">" + text + "</font>");
it works.
Regards