From 319f3c89b15aa3978877df976aa2bd740082ff50 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 21 Apr 2015 15:00:13 +0200 Subject: Add debug operator for QPrinterInfo. Add formatting helper to private class QPrintDevice and use that to implement debug operators for QPrintDevice and QPrinterInfo. Sample output: (QPrinterInfo(id="HP_Color_LaserJet_CM6030_MFP", state=0, name="HP Color LaserJet CM6030 MFP", makeAndModel="HP Color LaserJet CM6030 MFP Postscript (recommended)", default, defaultPageSize=QPageSize("Letter", "Letter", 612x792pt, 2), supportsCustomPageSizes, physicalPageSize=(278, 396)..(907, 1296), defaultResolution=600, defaultDuplexMode=0, defaultColorMode=1, supportedMimeTypes=( "application/pdf" "application/postscript" "image/gif" "image/png" "image/jpeg" "image/tiff" "text/html" "text/plain"))) Task-number: QTBUG-44991 Change-Id: I187414d2f68871e38ace0bd66661d2e37712f662 Reviewed-by: Andy Shaw --- src/printsupport/kernel/qprintdevice_p.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/printsupport/kernel/qprintdevice_p.h') diff --git a/src/printsupport/kernel/qprintdevice_p.h b/src/printsupport/kernel/qprintdevice_p.h index 6117239ac7..ad55cded0e 100644 --- a/src/printsupport/kernel/qprintdevice_p.h +++ b/src/printsupport/kernel/qprintdevice_p.h @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE class QPlatformPrintDevice; class QMarginsF; class QMimeType; +class QDebug; class Q_PRINTSUPPORT_EXPORT QPrintDevice { @@ -127,6 +128,10 @@ public: QList supportedMimeTypes() const; #endif +# ifndef QT_NO_DEBUG_STREAM + void format(QDebug debug) const; +# endif + private: friend class QPlatformPrinterSupport; friend class QPlatformPrintDevice; @@ -136,6 +141,9 @@ private: Q_DECLARE_SHARED(QPrintDevice) +# ifndef QT_NO_DEBUG_STREAM +Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrintDevice &); +# endif #endif // QT_NO_PRINTER QT_END_NAMESPACE -- cgit v1.2.3