Detecting if printer is ready (connected and supplied)
-
Hello !
I want to know if a specific printer is connected to my computer (Windows).
I already read this topic :
[https://forum.qt.io/topic/14320/detecting-a-printer-connection](link url)But QPrinterInfo::state() sends me "Idle" even if the printer is not supplied and the "printers and scanners" section in windows tells me it is offline.
Windows can tell if the printer is online or offline => I want to know that, and QPrinterInfo::state() doesn't tell me that.
Do you know how to do that ?
-
printers and their features are too varied to provide a common API that is realiable. I mean there are like 12 different common networking protocols that are used to forward print jobs, and each printer tends to have its own "language", although a few are more common than others.
-
OK, thank you Kent,
If I understand it well, if it would have been possible to know if my printer is online or offline, QPrinterInfo::state() would have told me that. But my printer may be too specific (it's a sticker printer ZEBRA), that's why QPrinterInfo::state() can't tell the real state of the printer.
Is that correct ?I will deal with it differently. Thanks again !
-
OK, thank you Kent,
If I understand it well, if it would have been possible to know if my printer is online or offline, QPrinterInfo::state() would have told me that. But my printer may be too specific (it's a sticker printer ZEBRA), that's why QPrinterInfo::state() can't tell the real state of the printer.
Is that correct ?I will deal with it differently. Thanks again !
@Blogie
We are saying it's not something Qt knows about. If there are Windows-specific libraries/calls which can detect "printer connection" --- as there probably are --- you can use those instead from your Qt/C++ program if you want that level of information.