diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-03-21 17:17:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-23 00:41:34 +0100 |
commit | b188221fee0eaacec115b514185a0508ef655897 (patch) | |
tree | 167b09e47cc3b63dadf64527339a4248eda770b3 /src/printsupport/kernel/qprinter.cpp | |
parent | 82c974f753e0081f8bedc356ea07a8cfa6fae583 (diff) |
Fix QPrinter test in Windows
Fixed Q_WS_WIN flagging to Q_OS_WIN in QPrinter API and related
implementation to make API match the documentation and Qt 4.8.
Also Removed the unused internal HDC related functions from the API,
that were previously behind Q_WS_WIN flag.
Some of the properties tested are documented to be valid for native
print engine only in X11 environment, so skipped testing those in
non-xcb environments.
Copy collation is also apparently not supported in Windows native print
engine, though this seems to be undocumented, so skipped that only in
Windows.
At least one of the test blocks in tst_QPrinter::valuePreservation()
failed due to default printer not getting set properly, so fixed that,
too.
Task-number: QTBUG-24191
Task-number: QTBUG-22927
Change-Id: I44a5e3d647a1279fcc7f1e99de6881f9be330246
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 404f45d509..d713639dcc 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -56,10 +56,6 @@ #include <QtPrintSupport/QPlatformPrinterSupport> #include <private/qpagedpaintdevice_p.h> -#if defined (Q_WS_WIN) -#include <private/qprintengine_win_p.h> -#endif - #if defined(Q_WS_X11) #include <private/qt_x11_p.h> #endif @@ -1722,7 +1718,7 @@ QPrintEngine *QPrinter::printEngine() const return d->printEngine; } -#if defined (Q_WS_WIN) +#if defined (Q_OS_WIN) /*! Sets the page size to be used by the printer under Windows to \a pageSize. @@ -1753,7 +1749,7 @@ int QPrinter::winPageSize() const Q_D(const QPrinter); return d->printEngine->property(QPrintEngine::PPK_WindowsPageSize).toInt(); } -#endif // Q_WS_WIN +#endif // Q_OS_WIN /*! Returns a list of the resolutions (a list of dots-per-inch @@ -1864,25 +1860,7 @@ QPrinter::PrinterState QPrinter::printerState() const Use printerState() == QPrinter::Aborted instead. */ -#ifdef Q_WS_WIN -/*! - \internal -*/ -HDC QPrinter::getDC() const -{ - Q_D(const QPrinter); - return d->printEngine->getPrinterDC(); -} - -/*! - \internal -*/ -void QPrinter::releaseDC(HDC hdc) const -{ - Q_D(const QPrinter); - d->printEngine->releasePrinterDC(hdc); -} - +#ifdef Q_OS_WIN /*! Returns the supported paper sizes for this printer. @@ -1907,7 +1885,7 @@ QList<QPrinter::PaperSource> QPrinter::supportedPaperSources() const return int_list; } -#endif +#endif // Q_OS_WIN /*! \fn QString QPrinter::printerSelectionOption() const @@ -1941,7 +1919,7 @@ QList<QPrinter::PaperSource> QPrinter::supportedPaperSources() const \sa printerSelectionOption() */ -#ifndef Q_WS_WIN +#ifndef Q_OS_WIN QString QPrinter::printerSelectionOption() const { Q_D(const QPrinter); @@ -2207,16 +2185,6 @@ QPrinter::PrintRange QPrinter::printRange() const Returns the current state of the printer being used by the print engine. */ -/*! - \fn HDC QPrintEngine::getPrinterDC() const - \internal -*/ - -/*! - \fn void QPrintEngine::releasePrinterDC(HDC) const - \internal -*/ - /* Returns the dimensions for the given paper size, \a size, in millimeters. */ |