Results 1 to 5 of 5

Thread: how to control the scrollbar of QPlainTextEdit ?

  1. #1
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    1

    Question how to control the scrollbar of QPlainTextEdit ?

    i want to automationally clear the text in QPlainTextEdit before the showing of it's scrollbar,

    what can i do?

    tks!

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to control the scrollbar of QPlainTextEdit ?

    please elaborate...
    You want to call QPlainTextEdit::clear() upon the there are too many lines in the textedit's content? Are you talking of user modifications or of programmed additions (as in a log).

    If it's the latter, why not just override appendPlainText()?
    (Anyway, there are too many possibilities that we can sugges what to do unless you provide us with more details.)

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

    csoapy (11th November 2008)

  4. #3
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    1

    Default Re: how to control the scrollbar of QPlainTextEdit ?

    thanks.

    i am writting a debugger of serial port.

    at some time, if there are many data comming to serial port, if the window which displaying data, scrolling endless, the usr can not see clearly data.

    otherwise, if i use appendPlainText , it well be a new line in debug window, not the origal data.

  5. #4
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to control the scrollbar of QPlainTextEdit ?

    have you had a look at QPlainTextEdit::maximumBlockCount()?

  6. #5
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    1

    Default Re: how to control the scrollbar of QPlainTextEdit ?

    this property can be used to clear QPlainTextEdit while the scroll will be visable?

Similar Threads

  1. Treeview scrollbar not updating when inserting rows
    By Khal Drogo in forum Qt Programming
    Replies: 11
    Last Post: 29th November 2007, 13:13
  2. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 13:15
  3. about scrollbar style
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 13:34
  4. Replies: 6
    Last Post: 3rd February 2006, 09:48

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.