Results 1 to 2 of 2

Thread: QPlainTextEdit scroll to bottom

  1. #1
    Join Date
    Jul 2013
    Qt products
    Qt4 Qt5
    MacOS X Unix/X11 Windows

    Default QPlainTextEdit scroll to bottom

    In order to scroll QPlainTextEdit contents to bottom, I've tried
    Qt Code:
    1. ui->plainTextEdit->verticalScrollBar()->setValue(ui->plainTextEdit->verticalScrollBar()->maximum());
    To copy to clipboard, switch view to plain text mode 
    which works partially. The QPlainTextEdit is in one tab of a QTabWidget, if the focus is in the QPlainTextEdit tab then it works. But, if data is added while the focus is in another tab, when I go back to the QPlainTextEdit tab it only shows one line of text at the top.

  2. #2
    Join Date
    Mar 2009
    Brisbane, Australia
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Unix/X11 Windows
    Wiki edits

    Default Re: QPlainTextEdit scroll to bottom

    What does scrolling to the bottom of existing content have to do with adding more content, how much of that content is visible, or focus? We cannot see your code or output so we can only fguess.

    Please provide a small example of code that demonstrates the problem.

    You should also consider QPlainTextEdit::centerCursor() and QPlainTextEdit::ensureCursorVisible()

Similar Threads

  1. Replies: 13
    Last Post: 4th August 2021, 16:47
  2. Replies: 2
    Last Post: 27th September 2011, 12:46
  3. QPlainTextEdit auto scroll
    By faldzip in forum Qt Programming
    Replies: 5
    Last Post: 13th January 2010, 18:11
  4. Continously Scroll QPlainTextEdit
    By GimpMaster in forum Newbie
    Replies: 2
    Last Post: 12th September 2008, 17:35
  5. Replies: 7
    Last Post: 15th November 2007, 17:19


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.