Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.1
-
None
-
Windows XP SP3, Visual Studio 2005
Description
Consider this :
QPrinter printer;
printer.setPrinterName("\\\\Server
SharedPrinter");
bool b1 = printer.isValid();
QPainter painter;
bool b2 = painter.begin(&printer);
If the remote printer isn't declared in the local list of printers, printer.isValid() returns false. Yet painter.begin() returns true, and printing works correctly.
If this is intended behavior, maybe the documentation for QPrinter::isValid() should mention that it only works with local printers. And also that a false return value doesn't necessarily mean that printing will fail.
As we can't rely on QPrinter::isValid(), in the windows version of our software, we replaced it by a custom function that calls Win32's OpenPrinter() and GetPrinter() to really check if the printer exists. But this solution might be a little heavy for QPrinter::isValid().
Attachments
Issue Links
- is required for
-
QTBUG-25377 QtPrintSupport - Remote Printer Issues
- Open
-
QTBUG-25384 QtPrintSupport - Windows issues
- Open