Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to scrolldown/scrollup the listview automatically whenever an item is added at the end /removed from listview?

How to scrolldown/scrollup the listview automatically whenever an item is added at the end /removed from listview?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 684 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    divaindie
    wrote on last edited by
    #1

    Hi All,
    How i can scroll down listview to the end to show last item (which present at below )whenever a new item is added.similarly whenever an item removed at the end how to scroll up.

    ODБOïO S 2 Replies Last reply
    0
    • D divaindie

      Hi All,
      How i can scroll down listview to the end to show last item (which present at below )whenever a new item is added.similarly whenever an item removed at the end how to scroll up.

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @divaindie hi
      see this methods

      positionViewAtBeginning()
      positionViewAtEnd()
      positionViewAtIndex(int index, PositionMode mode)
      
      1 Reply Last reply
      2
      • D Offline
        D Offline
        divaindie
        wrote on last edited by
        #3

        i think this function positionViewAtIndex(int index, PositionMode mode) what iam searching for !!

        1 Reply Last reply
        0
        • D divaindie

          Hi All,
          How i can scroll down listview to the end to show last item (which present at below )whenever a new item is added.similarly whenever an item removed at the end how to scroll up.

          S Offline
          S Offline
          sharath
          wrote on last edited by sharath
          #4

          Hi @divaindie ,
          Whenever the new item is removed, you just set the contentY of listview to zero.
          listview.contentY =0; //scroll up
          listview.contentY =listview.height; //scroll down whenever item is added (just assign some positive value and see the reflection)

          And also you can use following methods
          positionViewAtBeginning()
          positionViewAtEnd()

          this code may help you to solve your problem.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            divaindie
            wrote on last edited by
            #5

            thanks all for reply , i solved this with "positionViewAtIndex".

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved