문제

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 ??

도움이 되었습니까?

해결책

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:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top