PDA

View Full Version : How to do this? Please help.



patrick772goh
7th August 2007, 10:14
:(
i am using the text edit, when the word exceed the size of text edit, the text edit automatically have the vertical scrol bar ready. I always load a bunch of string data into the text edit, before launch the system load. These string will stored in the text edit.
The problem i encounter is that each time loading the text edit, the vertical bar already scrolled to the end of the text edit box.
Desired behavior: Vertical scrol should be the data loaded into the text edit, and the vertical bar become visible and the vertical scrol bar should at top and not at bottom.

jpn
7th August 2007, 10:32
As far as I remember, QTextEdit does not scroll automatically like that. However, if it does, try forcing the value of the scroll bar to 0. You can access the scroll bar via QAbstractScrollArea::verticalScrollBar().

patrick772goh
7th August 2007, 10:56
i used the "append" function.

patrick772goh
7th August 2007, 11:05
i dunno how to set the vertical scrol textedit to 0 position.
i using QT4.3 and visual studio 2003,
teInfo is a textedit.
"ui.teInfo->verticalScrollBar(0);"

jpn
7th August 2007, 11:11
Ok, seems I was wrong, it does scroll automatically. :) Try with:

ui.teInfo->moveCursor(QTextCursor::Start);