[Qt-interest] QTextDocument::drawContents() draw untranslated?
Josh
jnfo-c at grauman.com
Thu Jun 25 19:54:27 CEST 2009
Hello,
I'm trying to use QTextDocument::drawContents(&painter, view) to draw a
document to a painter. It's clipping when I get too far in my document.
I'm assuming this is because QPainter is limited by a short int, although
I don't know that for sure. An easy solution would be if
QTextDocument::drawContents() could draw "translated", rather than just
clipped. For example, painter.drawPixmap() has a source and destination
QRect. Any thoughts/ideas? I'd rather not have to draw to a QPixmap
first... Thanks.
for (int page=0; page<pageCount; page++)
{
QRectF view(0, page*pageHeight, pageWidth, pageHeight);
painter.translate(0, -page*pageHeight);
//I think when page gets too large this isn't working...
document()->drawContents(&painter, view);
//I would like this to have a source AND destination QRect
}
More information about the Qt-interest-old
mailing list