Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9.2
-
None
-
2b51ad471270c01858369f10c7645d863d89160c
Description
my code, which has not been modified, worked with qt-5.9.1
QPrintDialog appears and I select a printer, but the log file shows:
check for printer
result:1
page 767 x 1110
Could not determine printer to print to
My code is:
QtPdf::QtPdf(const RptType tp, const short id)
{
QString fn = QDir::homePath() + "/reports/doc-";
fn += QString::number(id) + ".pdf";
printer.setOutputFileName(fn);
printer.setDocName("Invoice");
printer.setColorMode(QPrinter::Color);
printer.setFontEmbeddingEnabled(true);
QPageLayout qpl;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setPageLayout(qpl);
printer.setPageOrientation(QPageLayout::Portrait);
printer.setCreator("xyz SCRL");
QPrintDialog *dialog = new QPrintDialog(&printer);
dialog->setWindowTitle("Print Document");
if (dialog->exec() != QDialog::Accepted)
return;
dY = BORDER_TOP;
painter.begin(&printer);
QFont qf;
qf.setFamily(DEFAULT_FONT);
painter.setFont(qf);
QRectF pz = printer.pageRect(QPrinter::DevicePixel);
pageHeight = pz.bottom();
pageWidth = pz.right() - pz.left();
cout << "page " << pageWidth << " x " << pageHeight << endl;
getCoy();
SetFontSize( 10 );
switch (tp) {
case invoice: getInv(id); break;
case reminder: remind(id); break;
}
}
Attachments
Issue Links
- relates to
-
QTBUG-63954 [REG 5.9.2 -> 5.10] Cannot print from any Qt-based application to printer or cups-pdf
- Closed