Results 1 to 5 of 5

Thread: Put QWidget in a QTextEdit

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Put QWidget in a QTextEdit

    You could try combining Qt::WA_DontShowOnScreen with QWidget::render(). First one is a flag that makes your widget invisible, but with 'visible' porperty set to true - so you get all Paint events and so on. Now catch Paint events with some event filter or something and render your widget to pixmap, which you can place in QTextEdit. In this solution, every Paint event will fire QWidget::render() to render the actual widget state on the pixmap - just refresh it every time and you will have even blinking vista progressbar :]. Worse thing is with event handling - you have to catch for example mouse moves and clicks on you displayed pixmap and send them to the right part of your invisible widget.

    P.S. Try giving names to your classes diffrent than "Q..." as it can lead to some misunderstandings, and read your Qt license to see if it is allowed - i dont know, but check just in case
    Last edited by faldzip; 16th September 2009 at 12:01.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. Adding a scrollbar to a QWidget
    By qtUser500 in forum Newbie
    Replies: 13
    Last Post: 2nd September 2009, 19:48
  2. Drawing on QTextEdit
    By jgrauman in forum Qt Programming
    Replies: 3
    Last Post: 7th February 2009, 09:40
  3. Replies: 0
    Last Post: 11th November 2008, 15:36
  4. Dynamic updates of a QWidget in a QScrollArea
    By plamkata in forum Qt Programming
    Replies: 2
    Last Post: 20th July 2008, 23:45
  5. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.