PDA

View Full Version : how to control the scrollbar of QPlainTextEdit ?



csoapy
11th November 2008, 03:41
i want to automationally clear the text in QPlainTextEdit before the showing of it's scrollbar,

what can i do?

tks!

caduel
11th November 2008, 08:09
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.)

csoapy
11th November 2008, 08:48
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.

caduel
11th November 2008, 09:27
have you had a look at QPlainTextEdit::maximumBlockCount()?

csoapy
15th November 2008, 15:09
this property can be used to clear QPlainTextEdit while the scroll will be visable?