PDA

View Full Version : Printing Overlay and QTextEdit



jgrauman
24th June 2009, 20:05
Hello,

I've created a widget as an overlay over a QTextEdit. I've painted on the Overlay to draw shapes, etc. on the QTextEdit. Now I'd like to print the QTextEdit with the Overlay as well. I'd like the QTextEdit broken up to pages, etc. that is normally done when printing. I see that QTextDocument has a function void drawContents(QPainter * p, const QRectF & rect = QRectF()) that looks useful. But I'm not quite sure how to proceed. Any ideas of how to print the (paginated) document with the overlay printed as well? Thanks.

Josh

wysota
24th June 2009, 20:47
Long story short - I don't think this will work. I suggest you use QGraphicsView and place QGraphicsTextItem and other primitives over it. But you won't get pages automatically this way.