Qt-interest Archive, July 2006
QPicture, QPainter, clipping
Message 1 in thread
Hello,
some days ago I asked some questions about QTextDocument and a possibility
for producing QPictures out of a QTextDocument. These QPictures were
supposed to be used in a simple Print-Preview-Widget. I only get the first
page shown correctly. As it seems to me, the function
QAbstractTextDocumentLayout::draw() doesn't deal properly with the given
clipped PaintContext. Here I found another posting describing the same
problem:
http://www.qtcentre.org/forum/f-qt-programming-2/t-printing-qtextdocument-by-painting-not-the-print-func-2816.html
Now I "dump" the whole content of my QTextDocument to a big QPicture and try
to produce pageCount x smaller QPictures out of this.For drawing a certain
region from a QPixmap on a paint device there exist
QPainter::drawPixmap (const QRect& target, const QPixmap& pixmap, const
QRect & source). But there is no analogous function to draw a clipped
QPicture. I tried to dump QTextDocument to a QPixmap first and to paint
with QPainter::drawPixmap on QPictures. It works but the result looks very
ugly...
To cut a long story short: I need to copy only a certain region from a big
QPicture to the smaller QPicture. How can I achieve this?
This problem took me a lot of time and makes me sick. So, I very much
appreciate any help on this topic.
Thanks,
Alexander Semke.
--
[ signature omitted ]