Hello. How can I print a page that isn't showed on a window/widget?
Qt Code:
  1. QPainter painter(printer);
  2. m_webView->page()->setViewportSize(m_pageToPrint->mainFrame()->contentsSize());
  3. painter.scale(scale, scale);
  4. m_pageToPrint->mainFrame()->render(&painter);
To copy to clipboard, switch view to plain text mode 
This is the code used( now is converted from m_webView to m_pageToPrint) to print the page from webView, which is showed, but the code for m_pageToPrint which isn't showed, only loaded with the HTML to be printed? The result of the above code is a white page in the PrinterPreviewer.
This is the code to load the html and after to call the previewer:
Qt Code:
  1. m_pageToPrint->mainFrame()->setHtml(finalHTML);
  2. m_printPreviewDialog->exec();
To copy to clipboard, switch view to plain text mode 
finalHTML is a valid html code.