Thanks ChrisW67. It worked. Code below:
Qt Code:
  1. QPrinter impressora(QPrinter::HighResolution);
  2.  
  3. QTextDocument document;
  4. document.setHtml(html);
  5. if(matriz == true)
  6. {
  7. QTextCursor cursor(&document);
  8.  
  9. QPalette palette;
  10.  
  11. palette.setColor(backgroundRole(), QColor(255, 255, 255));
  12. this->ui->tab_3->setPalette(palette);
  13. this->ui->tab_3->setAutoFillBackground(true);
  14.  
  15. QPixmap pm = this->ui->tab_3->grab();
  16. pm = pm.transformed(QTransform().rotate(270));
  17.  
  18. cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
  19.  
  20. QImage img = pm.toImage();
  21. img = img.scaledToHeight(img.height()-60);
  22. cursor.insertImage(img);
  23.  
  24. this->ui->tab_3->setAutoFillBackground(false);
  25. }
  26.  
  27. document.print(&impressora);
To copy to clipboard, switch view to plain text mode