Results 1 to 2 of 2

Thread: QPlainTextEdit, focusing on last line

  1. #1
    Join Date
    Jul 2009
    Posts
    39
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default QPlainTextEdit, focusing on last line

    In a while loop, I'm adding new lines to my QPlainTextEdit using insert() function, I want to keep focus on last line, but I could not manage. How can I do this?

    Thanks.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPlainTextEdit, focusing on last line

    after adding a line
    use moveCursor() to move the cursor to the end..
    and use the verticalScrollBar() from QAbstractscrollarea and set its value to maximum..

  3. The following user says thank you to nish for this useful post:

    metdos (27th July 2009)

Similar Threads

  1. Why is my application's CPU usage always > 50%
    By richardander in forum Qt Programming
    Replies: 10
    Last Post: 14th October 2010, 22:22
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.