Printing Widgets: Why are they rendered into Pixmap / Bitmap?
Hi all.
my Question is very similar to this one (http://www.qtcentre.org/threads/4334...pixmap-backing) which hasn't been answered.
How do I print Widgets "in the right way"?
I've got a bunch of Widgets in a Layout that I want to be printed out.
My idea was:
Code:
...
painter.begin(printer);
//Scale to Page Size
double xscale = printer->pageRect().width() / double(m_current_page->page->width());
double yscale = printer->pageRect().height() / double(m_current_page->page->height());
painter.scale(xscale, yscale);
content
->render
(&painter,
QPoint(),
QRegion(),
QWidget::DrawChildren);
//I've also simply using content->render(&painter);
This seemed to be very easy, but the problem now is:
I may choose between Highresolution and slow printing and big Filesize (when printing to a PDF).
Or: bad Resolution.
My question is: Why does Qt print by rasterizing the whole Widgets (including their Labels etc). into Pixmaps?
And what can I do against that?
Or am I completely wrong when trying to print them this way?
Thanks.
Mr.Green
Re: Printing Widgets: Why are they rendered into Pixmap / Bitmap?
Quote:
Originally Posted by
Mr.Green
Why does Qt print by rasterizing the whole Widgets (including their Labels etc). into Pixmaps?
Because widgets are drawn using raster graphics.
Quote:
And what can I do against that?
Don't print widgets. Print vector graphics and text.
Re: Printing Widgets: Why are they rendered into Pixmap / Bitmap?
So that means I would have to re-invent the layouting System...?
Re: Printing Widgets: Why are they rendered into Pixmap / Bitmap?
I have no idea why you want to print widgets so I cannot answer your question. Usually you'd be printing documents and not widgets.