[Kde-print-devel] Status of KDEprint in 4.0, and offer of help

Alex Merry huntedhacker at tiscali.co.uk
Fri Sep 7 15:35:50 CEST 2007


On Friday 07 Sep 2007, Goffioul Michael wrote:
> > On Wednesday 05 September 2007 09:53:08 Goffioul Michael wrote:
> > > 1) make KPrinter inherit QPrinter
> >
> > For all us new to the kdeprint framework, I'd really like to
> > know *all* the reasons why we need a KPrinter class in the
> > first place :)
> >
> > Would you be able to write provide us with that list?
>
> Honestly, I don't remember exactly *all* the reasons. It's almost
> 7 years ago and at that time, it was Qt-2.x; the print API was
> much less flexible that it is now. But IIRC, it was mainly due
> to the lack of polymorphism of the Qprinter class (for instance,
> setters were virtual, but not the getters) and its limited
> support for print options, which made it difficult to extend
> (for instance, margins were specified as 2 numbers, while I wanted
> it as 4 numbers).

I've gone through the KPrinter methods that are duplicated in QPrinter, 
and everything except the stuff dealing with dialog pages (ie: all the 
getter and setter methods) are simply passed to QPrinter's QPrintEngine 
now.  There is also scope for passing other properties to the 
QPrintEngine.

As for the dialog pages - the Qt4 way is to call the 
Q[Abstract]PrintDialog constructor with the QPrinter as an argument, 
rather than calling QPrinter::setup().  We could adopt that approach 
(keeping KPrinter::setup() for compatibility, as QPrinter does) with a 
public KPrintDialog class.  Even if KPrintDialog can't inherit from 
QAbtractPrintDialog (I haven't looked at that yet).  That would have 
the advantage that you can use QPrintDialog to set up a KPrinter 
(solving at least part of the issue of Windows printing - the dialog; 
which should provide the printer name...).

So I certainly think it's feasible, and I suspect it will make kdeprint 
a bit simpler (although it's going to be quite a bit of work converting 
it... I'll try putting a skeleton together this weekend to see how it 
looks).

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: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-print-devel/attachments/20070907/7f1ddcae/attachment.pgp 


More information about the Kde-print-devel mailing list