[Development] Adding CPD support to Qt print dialog

Shawn Rutledge Shawn.Rutledge at qt.io
Mon Sep 26 18:00:39 CEST 2022


On 2022 Sep 26, at 16:54, Volker Hilsheimer <volker.hilsheimer at qt.io<mailto:volker.hilsheimer at qt.io>> wrote:

I think it will be easier to understand what abstraction we need once we have a patch to look at that implements CPDB support. That we don’t have a QPA-level abstraction for print dialogs in Qt shouldn’t block adding CPDB support.

However, rather than throwing more #if’ery complexity into qprintdialog_unix.cpp it might be best to make a dedicated implementation of a CPDB-dialog.

But it was already pointed out that the widget dialog is intended to look exactly the same, right?  This is not a native dialog, it’s just a different backend that the same old widget dialog should learn how to deal with, AFAIU.  And qprintdialog_unix.cpp is really building up the widget hierarchy for it.  It has a complex feature set.  We haven’t been writing new widgets ourselves, and a few more #if’s will be less to maintain than a whole new widget-based dialog would be.

Refactoring into whatever plugins or QPA stuff is worth discussing, but I guess it will be easier to visualize the refactoring after we’ve got something that works.  And I haven’t dug into the implementation enough to think about whether anything there is reusable in Qt Quick.  QPrinterInfo is public, so I guess the first natural “model” for the dialog is going to end up being the list returned from QPrinterInfo::availablePrinters() anyway.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220926/046754cd/attachment.htm>


More information about the Development mailing list