On Fri, Dec 11, 2009 at 1:31 PM, Sundance <[email protected]> wrote:
> [..]
>
> As part of a helpful little feature that shows you the bottom of your text in
> a split screen while you scroll back, I use the awesome
> QTextDocument.drawContents() method. In short, you feed it a QPainter and a
> QRectF and it does what it says on the label: a slice of your document as
> delineated by the QRectF is rendered onto the QPainter.
> [..]
> And yet in the latter case, drawContents() renders nothing at all. Cursory
> investigation points to a different QAbstractTextDocumentLayout implementation
> under the hood depending on the TextEdit flavor in use.
Have you tried plaintext_edit.document().documentLayout().draw(paint, context) ?
Or you could try
  text_layout = QTextLayout()
  doc = plaintext_edit.document().clone()
  doc.setDocumentLayout(my)
  doc.drawContents(painter, rect)


Henning
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to