[Development] Adding CPD support to Qt print dialog

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Tue Sep 27 00:08:18 CEST 2022


That’s awesome, nice work Gaurav!

- Tor Arne

On 26 Sep 2022, at 18:47, Gaurav Guleria <gaurav.gen3 at gmail.com> wrote:



Yes, CPDB is just a different backend for the existing print dialog GUI. It's merely a different way of enumerating printers and their features.

I have already prepared a simple CPDB plugin (still requires a few changes and additions) which can already respond to QPrinterInfo::availablePrinters() queries: https://github.com/TinyTrebuchet/qtbase/commits/cpdb.

On 9/26/22 21:30, Shawn Rutledge wrote:

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.




_______________________________________________
Development mailing list
Development at qt-project.org<mailto:Development at qt-project.org>
https://lists.qt-project.org/listinfo/development


_______________________________________________
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220926/2caf525a/attachment.htm>


More information about the Development mailing list