Results 1 to 2 of 2

Thread: Printing Overlay and QTextEdit

  1. #1
    Join Date
    Nov 2007
    Posts
    16
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Printing Overlay and QTextEdit

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Printing Overlay and QTextEdit

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.