Skip to content
  • 0 Votes
    5 Posts
    2k Views
    B

    @jpnurmi said in ListView and PageIndicator - PageIndicator is not updated:

    The bindings are fine. The problem is that the ListView has only snapMode set, but highlightRangeMode seems to be missing. Therefore the ListView is not changing its currentIndex while flicking.

    snapMode does not affect the currentIndex. To update the currentIndex as the list is moved, set highlightRangeMode to ListView.StrictlyEnforceRange.

    https://doc-snapshots.qt.io/qt5-5.9/qml-qtquick-listview.html#snapMode-prop

    Thank you @jpnurmi.
    The following line solved the problem:

    highlightRangeMode: ListView.StrictlyEnforceRange

    Somehow I missed another thread: https://forum.qt.io/topic/81429/listview-does-not-change-currentindex-when-scrolling/6

  • 1 Votes
    4 Posts
    6k Views
    johngodJ

    First you should set the property interactive to false (true by default).
    Then you will have to force the flickable to move (when pressing a button, or when moving the mouse wheel event, for example) by incrementing/decrementing the contentX / contentY properties.
    Hope it helps.

  • 0 Votes
    1 Posts
    395 Views
    No one has replied