[RFC] Refactoring QPrinter (was: libkdeprint)

Tobias Koenig tokoe at kde.org
Tue Oct 16 17:45:50 BST 2007


On Tue, Oct 16, 2007 at 12:46:42AM +0100, Alex Merry wrote:
Hi,

After the discussion has left the main point ('How to get a working
printing solution for KDE4') maybe we should come back to hacking.

AFAIKS a major problem is that we can't pass PDFs or PSs to QPrinter
directly. One the one hand I can understand Trolltech that something
like that is not included in the API, as QPrinter is a paint device, not
a printing manager.

On the other hand we need something like a small, platform independent
printing manager which passes PDF/PS documents directly to the
underlying printing system.

QPrinter is already able to communicate with CUPS directly, by executing
'lpr' via pipe and writing PDF to its input descriptor.

So the only difference we need is, that not QPrinter writes into the
pipe end, but we passing our PDF/PS documents.
However this functionality is well hidden in qpdf_p.h/cpp, so not
accessable from kdelibs.

So my questions to the Trolls: Would it be possible to refactor QPrinter
and extract the communication with the printing backend into its own
class that can be used by KDE as well?

Qt would provide the following classes:

 - QPrintingSystem (or a better name ;))
    + allows to send raw files to the OS printing system

 - QPrinter
    + is a QPaintDevice
    + uses QPrintingSystem internally for printing PDF/PS documents

 - QPrintDialog
    + configures QPrinter
    + QPrinter passes through some settings to used QPrintingSystem

Ciao,
Tobias
-- 
Separate politics from religion and economy!
The Council of the European Union is an undemocratic and illegal institution!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071016/50d701b0/attachment.sig>


More information about the kde-core-devel mailing list