hi,

i've got a problem with a Qstring i want to print. the string is very long an contains a table made with <tr>, <th>, <br> and so on.

Printing it with the following configuration leads to a result, in which only one line exists and ends at the end of the page. The tags like <br> are idnored -simply printed-, too.
Qt Code:
  1. void THIS::printQString() {
  2.  
  3. Q_ASSERT(xLabel->text());
  4. QPrintDialog dialog(&printer, this);
  5.  
  6. if (dialog.exec()) {
  7. QPainter painter(&printer);
  8. QFont font("Courier", 8 );
  9. painter.setPen( Qt::black );
  10. painter.setFont(font);
  11.  
  12. painter.drawText(10, 10,xLabel->text());
  13. }
  14.  
  15. }
To copy to clipboard, switch view to plain text mode 

xLabel->setText(COMPLEXTEXT); does exactely what i want but painter.drawText(10, 10,xLabel->text()); doesn't format the QString in the same way. I want the printing result look exactely the same way as the QLabel xLabel (it fits on a page for sure).

How can this be done?