I would like to draw an Image inside a QText Document.
I used the code:
Qt Code:
  1. QImage geometry(300,200,QImage::Format_Mono);
  2. QPainter painter(&geometry);
  3. painter.setPen(QPen(Qt::black,12,Qt::SolidLine,Qt::RoundCap));
  4.  
  5. QLineF line1(10,80,80,80);
  6. QLineF line2(10,10,80,80);
  7. painter.drawLine(line1);
  8. painter.drawLine(line2);
  9.  
  10. m_cursor.insertImage(geometry);
  11. m_document->print(&printer);
To copy to clipboard, switch view to plain text mode 
where m_cursor is a QTextCursor on QTextDocument.
Hower, when I print the document on a pdf printer, I get an obscure image (no lines at all!).
Any idea?