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. ListView pixel-accuracy scrolling: How to stop ListView from jumping by entire item when scrolling
QtWS25 Last Chance

ListView pixel-accuracy scrolling: How to stop ListView from jumping by entire item when scrolling

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 2.1k 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.
  • C Offline
    C Offline
    CodaYoda
    wrote on last edited by CodaYoda
    #1

    Hi,

    I want to achieve smooth scrolling with ListView. By "smooth" I mean scrolling that does not jump by an entire list item at a time, which seems to be the default behaviour. To put it in other words, I want the type of scrolling that you get on just about any modern mobile device, where list items can be moved by a fraction of their size (essentially with pixel accuracy), not by a while item.

    To be clear, I know about ListView.NoSnap which allows the list to move by a fraction of an item's size, but what I am unable to achieve is to have partial elements shown at the top / bottom of the ListView when snapMode: ListView.NoSnap is enabled.

    This must be possible, but like pretty much all of QML, useful information is virtually impossible to find....

    Help would be greatly appreciated!

    p3c0P 1 Reply Last reply
    0
    • C CodaYoda

      Hi,

      I want to achieve smooth scrolling with ListView. By "smooth" I mean scrolling that does not jump by an entire list item at a time, which seems to be the default behaviour. To put it in other words, I want the type of scrolling that you get on just about any modern mobile device, where list items can be moved by a fraction of their size (essentially with pixel accuracy), not by a while item.

      To be clear, I know about ListView.NoSnap which allows the list to move by a fraction of an item's size, but what I am unable to achieve is to have partial elements shown at the top / bottom of the ListView when snapMode: ListView.NoSnap is enabled.

      This must be possible, but like pretty much all of QML, useful information is virtually impossible to find....

      Help would be greatly appreciated!

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @CodaYoda By default the scrolling in ListView is per pixel. Can you post an example where this behavior is defied ?

      157

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CodaYoda
        wrote on last edited by
        #3

        Hi,

        Thank you for the reply. Yes, an example is easy to provide:
        http://doc.qt.io/qt-5/qtquick-tutorials-dynamicview-dynamicview3-example.html

        Please note that my point is not that ListView doesn't scroll per pixel - it does. My point is that the contents of ListView are only shown as entire Items rather than being shown partially as the ListView scrolls (entire items are added / removed from view). This gives the impression that overall scrolling is not per-pixel.

        p3c0P 1 Reply Last reply
        0
        • C CodaYoda

          Hi,

          Thank you for the reply. Yes, an example is easy to provide:
          http://doc.qt.io/qt-5/qtquick-tutorials-dynamicview-dynamicview3-example.html

          Please note that my point is not that ListView doesn't scroll per pixel - it does. My point is that the contents of ListView are only shown as entire Items rather than being shown partially as the ListView scrolls (entire items are added / removed from view). This gives the impression that overall scrolling is not per-pixel.

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @CodaYoda No it is does not completely show entire items when scrolled. If you look carefully you will seen there is a small difference. To test it you can try setting the delegate height to something higher or lower or you can even try mouse drag and scroll.

          157

          1 Reply Last reply
          0
          • johngodJ Offline
            johngodJ Offline
            johngod
            wrote on last edited by
            #5

            Not sure if I understand what you want, maybe you're looking for:

            clip: true

            1 Reply Last reply
            1

            • Login

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