What happens if you use a PrintDialog instead? Something like
Does it show a list of printers attached to the computer?Qt Code:
return; }To copy to clipboard, switch view to plain text mode
What happens if you use a PrintDialog instead? Something like
Does it show a list of printers attached to the computer?Qt Code:
return; }To copy to clipboard, switch view to plain text mode
QPrintDialog returns: QPrintDialog: Cannot be used on non-native printers
Because no printers are found.
I also have the same problem. On my development machine(Win7 64 Bit, Qt 5.2 mingw) it works. But when i deploy the application to another computer i get the warning:
QPrintDialog: Cannot be used on non-native printers
I tried it with WinXP on virtualbox, again the problem exists. plugins\printsupport\windowsprintersupport.dll and platform\qwindows.dll exists in binary folder.
Any idea ?
Sorry Yagabey, no idea. Also running under Win 7/64. I have 2 applications. Both use the same code. It works on one but not the other. The one that does not work returns a list of zero printers from QList <QPrinterInfo> plist = QPrinterInfo::availablePrinters();
And print dialog gives me the same error message that you get.
Hi guys! I had the same problem and the reason was I put the wrong "windowsprintersupport.dll" in "plugins\printsupport\" dir. There were two different dll files in my Qt dir. You should take the right one.
nils_heidorn (19th March 2015)
QPrintDialog can't be used with pdfs on Windows because it is a native print dialog and has no knowledge of Qt's PDF printer.
I have the same problem...
I changed the line
printer.setOutputFileName("Filename.pdf");
to
printer.setOutputFileName("Filename");
and the printdialog worked.
I made sure the print to file was not ticked...and whalla...(ozzie slang for great it worked)
a print of what I wanted worked.
Thanks for the Help to all
Bookmarks