[Qt-interest] Need help printing

Scott Aron Bloom Scott.Bloom at sabgroup.com
Thu Jul 30 01:21:47 CEST 2009


In case anyone was interested, I fixed the problem.

 

Looking at some of the examples I found, I had two major differences.

First, I was creating 1 printer but a new painter for every print.
Instead, I create a painter and send the painter into the widgets print
method.  This also required me to use the printer->newPage()
functionality.

 

Second, when the widget is getting printed, I now set the background to
transparent using setStyleSheet( "background-color: transparent" );  It
turns out the "default" background very light gray was getting printed.

 

Between those two changes, we are printing as fast as he expects.  

 

Thanks for all the help

Scott

 

From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Scott Aron Bloom
Sent: Saturday, July 25, 2009 10:20 PM
To: qt-interest
Subject: [Qt-interest] Need help printing

 

I have a system that works fine, but the printing is generally slow.

 

The general code is the following to setup the printer:

      QPrinter printer;

      QPrintDialog dlg(&printer, NULL);

 

                Create my Widget

 

                Widget->print( &printer )

 

Where widget::print is defined as following:
void print( QPrinter * printer )

{

      QPainter pp( printer );

      this->render( &pp );

}

 

Very straight forward.

 

 

The layout is a form based layout and there are really no
complexities...

 

But my customer is saying, that the PCL6X driver wont work without a
syntax error, but the old PCL5 works, but its prints at about 2-3 pages
per minute in comparision to the 20-30 ppm that other tools can put out.

 

Any ideas?  Any gotchas I should look for?

Scott

 

               =======

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090729/f2d5b6f3/attachment.html 


More information about the Qt-interest-old mailing list