Hi guys,
I'm trying to print to a dot matrix printer, but when printing, the printer advances a few pages to print. The following code:
prt->setPrinterName(ui.comboBox_Printers->currentText());
qDebug() << "Printer: " << prt->printerName(); // Ok, dot printer
prt->setFullPage(true);
painter.
drawText(10,
10,
200,
100, Qt
::AlignLeft | Qt
::AlignTop,
QString("Test printer"));
QPrinter *prt = new QPrinter;
prt->setPrinterName(ui.comboBox_Printers->currentText());
qDebug() << "Printer: " << prt->printerName(); // Ok, dot printer
prt->setPaperSize(QSizeF(191, 93), QPrinter::Millimeter);
prt->setFullPage(true);
QPainter painter(prt);
painter.drawText(10, 10, 200, 100, Qt::AlignLeft | Qt::AlignTop, QString("Test printer"));
To copy to clipboard, switch view to plain text mode
What may be happening?
Bookmarks