If I have this code:

Qt Code:
  1. ...
  2. QPainter *painter = new QPainter(this);
  3. painter->setPen(Qt::white);
  4. QAbstractTextDocumentLayout::PaintContext context;
  5. doc.setTextWidth(220);
  6. doc.setHtml(text);
  7. doc.documentLayout()->draw(painter, context);
To copy to clipboard, switch view to plain text mode 

the text is drawn in black instead of white? Only if i write:

Qt Code:
  1. doc.setHtml("<font color=\"white\">" + text + "</font>");
To copy to clipboard, switch view to plain text mode 

it works.

Regards