[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KPrinter tiny-HOWTO
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2002-03-28 9:39:07
[Download RAW message or body]

Hi,

If you're using KPrinter in your code, please consider reading this.
While implementing a generic print margins widget/setting mechanism
in KPrinter, I found some KPrinter usage that should be avoided, hence
this mail.

KPrinter uses internally a QPrinter object for PS generation. At this
moment, when you change something in KPrinter object, the internal
QPrinter object is not immediately updated as well. Synchronization takes
place (only once) at some specific locations: creation of QPainter and call
of KPrinter::printFiles(). This has some consequences on the use of KPrinter:

1) an application SHOULD setup KPrinter object before calling setup().
   Indeed, the print dialog content may depend on the state of KPrinter,
   like the presence of the new "Margins" tab in properties dialog.
   Ex: khtml.

2) an application SHOULD NOT change anything to KPrinter after having
   created a QPainter object. Indeed, the internal QPrinter will not be
   in sync then.

3) an application SHOULD avoid the change anything between the call to
   setup() and the creation of QPainter. This should be made possible soon
   but it's not possible at this moment. This is what khtml does, and caused
   (in cunjunction with buggy KPrinter of course) large print problems a
   couple of weeks (4?) ago.

Bye.
Michael.

-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul@imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic