In my application I need to detect is paper out or not after each printing. Unfortunately my printer driver doesn't have API to do that, so I'm going to check the PrintState property like this:
textDocument.print(&printer);
if (printer.
printerState() == QPrinter::Error) someErrorHandler
();
textDocument.print(&printer);
if (printer.printerState() == QPrinter::Error) someErrorHandler();
To copy to clipboard, switch view to plain text mode
The problem is that print() method returns not waiting for the end of printing, so I need to use sleep() function like this:
textDocument.print(&printer);
mySleep(10);
if (printer.
printerState() == QPrinter::Error) someErrorHandler
();
textDocument.print(&printer);
mySleep(10);
if (printer.printerState() == QPrinter::Error) someErrorHandler();
To copy to clipboard, switch view to plain text mode
Is there any way to run print() method synchronously or detect that printer is out of paper defferently?
Thanks!
Bookmarks