Printing: KPrintPreview
Alex Merry
huntedhacker at tiscali.co.uk
Fri Oct 5 14:44:22 BST 2007
On Monday 24 Sep 2007, Alex Merry wrote:
> I have here a working KPrintPreview class. It's a KDialog, and is
> used as follows:
>
> QPrinter printer;
> KPrintPreview preview(&printer, this); // where "this" is a QWidget
> doSomePrinting(printer);
> preview.exec();
> I temporarily named the library kdeprint2, so as not to interfere
> with kdeprint.
I'm going to put it into kutils, if that's OK. It seems stupid to have
a library just for one class. If people think it should go elsewhere
(such as kdeui), then I don't object to it being moved. Bear in mind
that it depends on libkparts.
I don't have time to do any porting. It should be a reasonably
straightforward job if the application is well-designed. Look at
http://doc.trolltech.com/4.3/printing.html to see how the Qt4 printing
system works. Basically, use QPrinter rather than KPrinter, and
QPrintDialog instead of KPrinter::setup().
Also, until there is a method for getting a QPrintDialog with an extra
widget, you'll have to disable any additional pages. They might
require more involved porting anyway.
If anyone is up for adding at least an API for a customised QPrintDialog
today, that would be great. Then applications can be ported and
hopefully start working when it is implemented (and when using Qt
4.3.2+).
Alex
--
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071005/78251aa7/attachment.sig>
More information about the kde-core-devel
mailing list