I have serious problem with QWebEngineView. I want allow to make preview web page before printing. I have following code:
Qt Code:
  1. void Deklaracje::PodgladWydruku() {
  2. if(!IsLoaded()) return;
  3. setLoaded(false);
  4. QPrinter* printer = new QPrinter();
  5. QPrintPreviewDialog dialog(printer, this);
  6. dialog.setWindowFlags (Qt::Window);
  7. connect(&dialog, SIGNAL(paintRequested(QPrinter*)), this, SLOT(printOnPrinter(QPrinter*)));
  8. dialog.exec();
  9. dialog.disconnect();
  10. }
  12. void Deklaracje::printOnPrinter(QPrinter* aPrinter)
  13. {
  14. ui->webEngine->page()->print(aPrinter, [=](bool result) {this->deleteCurrentPrinter(result); });
  15. setLoaded(true);
  16. }
To copy to clipboard, switch view to plain text mode 

But it not works! It shows an empty page and it prints on default printer (instead on preview window). What I doing wrong?

thanks in advance