I'm using Qt for a project (Qt 5.0.2, precompiled and downloaded from qt-project.org) on Windows 7 (32-bit) and I'm having trouble trying to print a document.
qDebug() << QPrinterInfo::availablePrinters().size(); // 0
I'm able to print as PDF and I tested the same executable in other computers, it works just well. I do have printers installed and I can print normally from any other program such as notepad or Word. Any clue on why is it returning an empty list? I can't find this behavior documented anywhere, is this a Qt bug?
When you deploy your Qt application, you should put
[your Qt application]\printsupport\windowsprintersupport.dll
The library windowsprintersupport.dll should be taken from
[Qt path]\[platform]\plugins\printsupport
P.S. The first answer is almost correct, except path's names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With