Results 1 to 5 of 5

Thread: How to do this? Please help.

  1. #1
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default How to do this? Please help.


    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to do this? Please help.

    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().
    J-P Nurmi

  3. #3
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to do this? Please help.

    i used the "append" function.

  4. #4
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to do this? Please help.

    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);"

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to do this? Please help.

    Ok, seems I was wrong, it does scroll automatically. Try with:
    Qt Code:
    1. ui.teInfo->moveCursor(QTextCursor::Start);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    patrick772goh (7th August 2007)

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.