path: root/src/plugins/printsupport
diff options
authorBradley T. Hughes <>2012-03-02 12:17:24 +0100
committerQt by Nokia <>2012-03-15 09:50:18 +0100
commit7e3c632e96dbbd6f577c2ba98464a54176c5b7b0 (patch)
treef45b610655c5362a8e027482d9d544a13f12d0d9 /src/plugins/printsupport
parentcad51669d83ff649fae70842abf095acb5b72abc (diff)
Port QMacPrintEngine and QCoreGraphicsPaintEngine from Qt 4 to Qt 5
Copy qprintengine_mac_p.h,, qpaintengine_mac_p.h, and qpaintengine_mac.cpp (as from src/gui/painting/ in the 4.8 branch of at commit e6bd33d4aef0e4538d7918e7ab130624c911b553. The following changes are necessary to port these files to the Qt 5 API: - The copyright notice on these files has been updated to match the header.LGPL template. - Fix #includes for qprintengine_mac* and qpaintengine_mac*, as some headers have moved in Qt 5. - Remove extern forward declarations for functions that no longer exist. - Remove friend declarations for classes/functions that are not part of the Cocoa platform plugin. - Remove QT_MAC_USE_COCOA blocks. Qt is always using Cocoa now, there is no need to keep the non-Cocoa code paths anymore. The QMacPrintEngine::shouldSuppressStatus() method was also removed, since it is no longer used. - Do not use Qt::UniteClip, it was removed in commit 01b72952c38b9193138eabdab6bdab632cd75ebd - Use QCocoaAutoReleasePool in - Use QPlatformPrintSupport::convert*() functions in QMacPrintEngine, since we cannot use non-exported functions from QtPrintSupport in the Cocoa plugin. - Use qt_mac_image_to_cg_image() to convert QPixmap to CGImageRef. First convert QPixmap to QImage (cheap, since the Cocoa platform plugin uses QRasterPlatformPixmap), and then convert the QImage to CFImageRef using the existing helper function. - Copy qt_mac_cg_context() to the Cocoa platform plugin from, adding a note at each location about the duplication. - Add qt_mac_QRegionToHIMutableShape() helper. Adapt the Qt 4.x code for QRegion::toHIMutableShape(), and use this in QCoreGraphicsPaintEngine. - Add qt_mac_drawCGImage() and qt_mac_get_scalefactor() helper. These functions are copied directly from the 4.8 branch of at the same revision shown above. - Add qt_mac_create_imagemask() helper in qpaintengine_mac.cpp. This helper is based on the function with the same name from the 4.8 branch of at the same revision shown above. The correctness of the implementation has not yet been verified. Since these files use the QPrinter API from QtPrintSupport, the Cocoa plugin now needs to link to that library as well. Change-Id: I90b9bbe201327489ef9e1b3294e68e91ddda27bd Reviewed-by: Morten Johan Sørvig <>
Diffstat (limited to 'src/plugins/printsupport')
0 files changed, 0 insertions, 0 deletions