Use QPainter. Here's an example from the docs:
Qt Code:
  1. void SimpleExampleWidget::paintEvent()
  2. {
  3. QPainter paint( this );
  4. paint.setPen( Qt::blue );
  5. paint.drawText( rect(), AlignCenter, "The Text" );
  6. }
To copy to clipboard, switch view to plain text mode 
Replace QPainter::drawText() with QPainter::drawRect()..