[Development] QtPrintSupport - Platform Support

John Layt jlayt at kde.org
Mon Apr 23 23:17:15 CEST 2012


On Monday 23 Apr 2012 13:20:08 morten.sorvig at nokia.com wrote:
> On Apr 22, 2012, at 10:43 PM, ext John Layt wrote:

> > OSX:
> > 
> > src/plugins/platforms/cocoa    - QMacPrintEngine
> >                                - QCoreGraphicsPaintEngine
> >                                - QCocoaPrinterSupport
> > 
> > src/plugins/printsupport/cocoa - QCocoaPrinterSupportPlugin

> > Windows:
> > 
> > src/plugins/platforms/windows  - none
> > src/plugins/printsupport/cocoa - QWindowsPrinterSupportPlugin
> >                                - QWindowsPrinterSupport
> > 
> > src/printsupport/kernel        - QWin32PrintEngine

> > Can anyone explain why we have these differences, or any objections why we
> > shouldn't move them around to be consistent:

> QMacPrintEngine and QCoreGraphicsPaintEngine are class names from Qt 4. For
> Qt 5 we adopted the "QCocoa" prefix - hence the mismatch. I would like to
> keep "QCoreGraphicsPaintEngine", which describes exactly what it is (I
> guess the same can be said for "QPdfPrintEngine"). QMacPrintEngine can be
> renamed to QCocoaPrintEngine.

Thanks, but perhaps I wasn't quite clear enough, I'm wondering why the Mac and 
Windows printersupport plugins are structured differently and why the 
files/classes themselves are in different locations and plugins.

For Mac I was more interested in why the classes are in 
plugins/platforms/cocoa instead of plugins/printsupport/cocoa or 
printsupport/kernel like for Windows.  Ideally, the platform plugins should 
know nothing about QtPrintSupport which we plan to deprecate later. All the 
QtPrintSupport specific classes should be in the separate printsupport plugin 
and so more easily switched when the new print module eventually appears.

I've looked at it a bit more and it seems to be related to 
QCocoaNativeInterface which has a couple of private Q_INVOKABLE methods 
related to creating the QCocoaPrinterSupport object, but I'm not sure why 
these need to be there when they could be in the QCocoaPrinterSupportPlugin?

For Mac I propose moving QCocoaPrinterSupport into plugins/printsupport/cocoa 
and moving the private methods from QCocoaNativeInterface to 
QCocoaPrinterSupportPlugin.  I'll do a patch.

A harder question is where QMacPrintEngine should be, should it go to 
plugins/printsupport/cocoa, or to printsupport/kernel like the current Windows 
and Cups implementations?  The QMacPrintDialog could have the same question, 
does it belong in plugins/printsupport/cocoa, or to printsupport/dialogs?  I'm 
inclined to have all the platform specific code in the plugin if possible, and 
change Windows and Cups to match.

Cheers!

John.




More information about the Development mailing list