Question

i need to know when my printer finish to print a document. In this particular case i an using QT 5.2 and Qprinter class, but i dont see where i can the finish event. I'am on Windows 7/8 computer, maybe the idea is use the printer queue.. please some ideas ??

Was it helpful?

Solution

There is no accurate way to detect the state of printer as some printers don't have the capability of reporting their state to the operating system.

But you can get the current state of the printer by:

PrinterState QPrinter::printerState() const

Which returns Idle, Active, Aborted and Error. I think if the printer state goes from Active to Idle then the job is finished. So you can periodically check the state of printer in a timer event and if the state goes from Active to Idle then you can emit a signal which shows that the printing is done:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top