Results 1 to 8 of 8

Thread: ListView in a ScrollView: How to know scroll position (is it at bottom?)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2013
    Posts
    61
    Qt products
    Qt4
    Platforms
    Windows

    Default ListView in a ScrollView: How to know scroll position (is it at bottom?)

    Hi,

    I have a WML application with a ScrollView and a ListView inside. The items from the ListView has variable height.

    I need to know when the scroll bar is moved, in fact when it is at bottom and when it is NOT.

    My target is to keep scroll at bottom (positionViewAtEnd()) when I add an item to the ListView ONLY if the scroll is at bottom. If NOT at bottom, positionViewAtEnd() will not be used.

    I have tried "playing" with height, contentHeigh & contentY. Sometimes it works (when scroll is at bottom: contentHeight == contentY + height), but other times contentY value changes to negative values, and my code fails...

    Any help?


    Thanks a lot

    Diego
    Last edited by ddonate; 23rd June 2016 at 09:11.

Similar Threads

  1. Replies: 13
    Last Post: 4th August 2021, 16:47
  2. Replies: 0
    Last Post: 7th February 2015, 16:01
  3. QPlainTextEdit scroll to bottom
    By vrltwe in forum Newbie
    Replies: 1
    Last Post: 15th August 2014, 21:44
  4. Replies: 0
    Last Post: 30th January 2014, 13:35
  5. Replies: 1
    Last Post: 29th September 2011, 07:51

Tags for this Thread

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.