Solved Why does QPrinterInfo::availablePrinters return empty list on PC with printers?
-
Both
QPrinterInfo::availablePrinters()
andQPrinterInfo::availablePrinterNames()
return an empty list on Windows PCs that nevertheless show printers when displayed in the Control Panel ➔ Devices & Printers.The printers are not connected to the computer. I would at least expect Qt to display the "Microsoft Print to PDF". This is also failing on PCs with WiFi printer connections.
Any suggestions on how to get a Printer dialog to display, that is populated with the same list of printers as a native app?
-
The problem was caused by not knowing that I needed to install the following in my app folder:
..\printsupport\windowsprintersupport.dll
Answered here: https://forum.qt.io/topic/39319/solved-qprinterinfo-availableprinters-don-t-list-available-printers