[RFC] Refactoring QPrinter (was: libkdeprint)
Thomas Zander
zander at kde.org
Wed Oct 17 07:09:54 BST 2007
Hi Tobias,
On Tuesday 16 October 2007 18:45:50 Tobias Koenig wrote:
> 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.
The structure in QPrinter (and QPainter) is that you choose a target you
write to and then use the paintengine API as a builder-interface to
construct your output.
This means that if you create a PDF or Postscript file you choose that
builder as a target. And it will then generate a file.
If, on the other hand, you choose a WIndows printer, you use a completely
different piece of code and you create raw data by painting on your
QPrinter.
Note that data can't be moved from one backend (pdf) to the other
(printing on Windows).
> 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?
No, that is technically impossible without adding a pdf-reader /
postscript reader that is capable of painting high-res output on a
QPrinter.
--
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071017/988b5337/attachment.sig>
More information about the kde-core-devel
mailing list