mSergey
18th January 2008, 12:04
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();
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();
Is there any way to run print() method synchronously or detect that printer is out of paper defferently?
Thanks!
textDocument.print(&printer);
if (printer.printerState() == QPrinter::Error) someErrorHandler();
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();
Is there any way to run print() method synchronously or detect that printer is out of paper defferently?
Thanks!