Thank you very much! That has worked. But now I encountered another problem.
When I'm calling QPrintPreviewDialog, there is two pages, thow I rendered only my central widget. So I have one page with my central widget and another page empty.
Also the Image is printed correctly on the page only if I open the app in fullscreen. If I call my app and it is not stretched to full screen than I see onle part of it on the first page.
I provide the code of my print preview SLOT and connects.
Qt Code:
  1. connect(prev_dialog, SIGNAL(paintRequested(QPrinter*)), this, SLOT(print_preview()));
  2. connect(ui->actionPrint_Preview, SIGNAL(triggered(bool)), this, SLOT(preview_called()));
  3. //////////////////////////////////////////////////////////////////////////////////////////
  4. void MainWindow::print_preview(void)
  5. {
  6. QPainter painter(&printer);
  7. painter.setWindow(this->geometry());
  8.  
  9. this->render(&painter);
  10. printer.newPage();
  11. /*if (prev_dialog->exec() == QDialog::Accepted)
  12.   {
  13.  
  14.   }*/
  15. }
  16.  
  17. void MainWindow::preview_called(void)
  18. {
  19. prev_dialog->exec();
  20. }
To copy to clipboard, switch view to plain text mode 
Thank you again for helping me to deal with this.