Results 1 to 3 of 3

Thread: repaint problem in QTextEdit

  1. #1
    Join Date
    Sep 2006
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default repaint problem in QTextEdit

    Hi all,

    Basically I'm displaying thousands of lines on a QTextEdit sequentially.

    However, no matter I use edit.append() or cursor.insertText(), lines are only displayed when all the lines are written and the editor is blocked until then.

    I try to use edit.repaint(), edit.update() and even thread.wait() after writing every line. But none of these work. What am I supposed to solve this problem?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: repaint problem in QTextEdit

    Try calling QCoreApplication::processEvents() in between appending text:
    Qt Code:
    1. edit.append(...);
    2. qApp->processEvents();
    3. edit.append(...);
    4. ..
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Sep 2006
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: repaint problem in QTextEdit

    It's working now.Great, thanks ~

Similar Threads

  1. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  2. QTextEdit problem
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2006, 11:56
  3. setting cursor problem in QTextEdit
    By jyoti kumar in forum Qt Programming
    Replies: 3
    Last Post: 19th May 2006, 08:17
  4. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  5. Problem with inserting text into QTextEdit
    By xorrr in forum Qt Programming
    Replies: 0
    Last Post: 6th February 2006, 11:45

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.