Future of KPrinter

Thomas Zander Thomas.Zander at trolltech.com
Tue Sep 11 16:07:17 BST 2007


On Tuesday 11 September 2007 14:13:50 Alex Merry wrote:
> On Tuesday 11 Sep 2007, Thomas Zander wrote:
> > On Saturday 08 September 2007 21:29:08 Alex Merry wrote:
> > > * Straightforward printer options (try clicking "properties" for a
> > > printer in the print dialog of the Qt assistant program, and doing
> > > the same in kolourpaint), ie: integration with KDE print management
> > > system
> >
> > Yeah, I kind of like the Gui in KDE and the richness of features. The
> > thing is; there need not be any difference between Qt and KDE in this
> > respect.
> > The Qt dialog has issues, for sure, and those need fixing. So my
> > suggestion is that we do that in a way that both Qt and KDE like the
> > newly created QPrintDialog. Saves a lot of duplication :)
>
> My intention was to follow the QPrintDialog use pattern with
> KPrintDialog anyway - KDE Print has always tried to behave like
> QPrinter from an application developer's point of view.

Trolltech thinks the QPrintDialog as it exists on Unix needs work, and I'm 
quite fond of the KDE one we have in KDE3.  So what about joining forces and 
making the QPrintDialog rock, and thus make all our lives easier?

> > > * Printing a list of pages (such as 1,4,6-8) or the current page -
> > > would required extending QPrinter and implementing our own
> > > KPrintDialog, or we could just tell people to get this info from
> > > KPrintDialog (it's only needed by the application, not by the
> > > printing system)
> >
> > QPrinter already has this. As does the QPrintDialog.
> > See QPrinter::fromPage(), QPrinter::toPage()
>
> That only allows you to print, eg: pages 4-8.  Not page 1, page 4, pages
> 7-9 and pages 14-18.  QTestDocument::print() can't do this, because the
> user can't select it in QPrintDialog and QPrintDialog can't tell
> QPrinter about it.

What QPrinter now has are 3 modes;
1) Print all of the document.
2) Print a page-range.  Which has a start and an end.
3) Print a selection of pages.
QPrinter has this mode as a setter, but the most used usecase is shown pretty 
clearly in KGhostView with its checkboxes under the pages.  This means that 
the application, not the print engine has a selection.
The printing engine can't know which pages need to be printed, it still needs 
to be the application that chooses to print a page or not.
The alternative is to print/paint the whole document and then to post process 
the result to remove the pages you don't want.  This is suboptimal, but can 
be useful if the app doesn't want to support this.   The print-preview dialog 
can do this, though.  Which again means no support in QPrinter is needed.

Would that work for you?

> > > * "Special" printers (like Send Fax via KFax) independent of eg:
> > > CUPS - would require extending QPrinter and implementing our own
> > > backends (which might use a Qt builtin backend when not printing to
> > > the special printers)
> >
> > I'm thinking this can actually be done using the
> >   QPrinter::setPrintProgram (const QString &)
> > method already.
>
> Actually, I think you're right about that.  It still requires our own
> KPrintDialog, though.

Why?
What kind of option can not be added to a revamped QPrintDialog?

> > > * Print preview - more complicated.
> >
> > We looked at this and we have a preview dialog that will be available
> > on the labs soon, and will likely be added to 4.4.
>
> Do you know what the use pattern will be?  ie: how does the application
> developer get the preview to display?  If we implement a stand-in for
> 4.0, I think we should follow the same pattern.

I talked here at TT and I'm aiming for some blogging goodness start of next 
week by the guy that made it.

> I think we may still need KPrintDialog for integration with the control
> panel (when clicking Properties).  But we'll discuss that on Wednesday,
> along with the other bits.

Ok, speak to you then.
-- 
Thomas Zander
-------------- 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/20070911/5d5096f9/attachment.sig>


More information about the kde-core-devel mailing list