KPrinter::pageSize() never changes in 3.1.4

Michael Goffioul goffioul at imec.be
Mon Oct 13 09:31:22 CEST 2003


Todd Shoemaker wrote:

> Michael-
> 
> Ignore my last email.  I figured out that calling abort() before the
> qpainter destructs will keep the print operation from actually
> starting.  The KDE progress dialog flashes briefly, but I'm sure I can
> disable that somehow, and if not it will be acceptable for now.

The actual function that should be called on KPrinter is
preparePrinting(). This function is triggered when you
contruct a QPainter on it. The problem is that this
function is protected, so you don't have access to it. The
easiest way in your case is then to inherit from KPrinter
and provide an access to this function, like:

class MyPrinter : public KPrinter
{
public:
     void doPreparePrinting() { preparePrinting(); }
}

and then in your code:

if (kprinter.setup())
{
    printer.doPreparePrinting();
    /* now page size should be correct */
}

Michael.

-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul at imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------




More information about the kde-print mailing list