Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
None
-
5.4.0
-
None
-
Windows 7 64bit, Mingw 4.9.1 (32bit)
Description
Using code like this:
QPrintPreviewDialog ppd;
QObject::connect(&ppd, SIGNAL(paintRequested(QPrinter*)), this, SLOT(request(QPrinter*)));
ppd.exec();
...
void MainWindow::request(QPrinter *printer) {
ui->textBrowser->print(printer);
}
Dialog show a empty preview.
Using like this the app crash:
//Note: no added printer var to ppd QPrinter printer; printer.setPaperSize(QPrinter::A4); printer.setPageMargins(20, 20, 20, 20, QPrinter::Millimeter); printer.setResolution(300); QPrintPreviewDialog ppd; QObject::connect(&ppd, SIGNAL(paintRequested(QPrinter*)), this, SLOT(request(QPrinter*))); ppd.exec();//This line crash app
or (crash too):
QPrinter printer; printer.setPaperSize(QPrinter::A4); printer.setPageMargins(20, 20, 20, 20, QPrinter::Millimeter); printer.setResolution(300); QPrintPreviewDialog ppd(&printer); QObject::connect(&ppd, SIGNAL(paintRequested(QPrinter*)), this, SLOT(request(QPrinter*))); ppd.exec();//This line crash app
When app crash show this message:
QWin32PrintEngine::initialize: CreateDC failed ()
QWin32PrintEngine::initialize: CreateDC failed ()
Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly