Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48633

ListView currentIndex forced to zero when list model is changed, even when it was previously -1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.5.0 RC
    • None
    • Mac OS 10.10.4, Xcode 6
    • macOS

      Create a simple ListView. When you change its model property value to a different integer value, the ListView automatically changes its currentIndex to 0, even when the currentIndex previous value was -1. This seems wrong.

      The currentIndex value of -1 is used by the programmer to indicate there is no current selection and that the ListView is to clear its currentItem in the ListView. Subsequently changing the model property value should not force there to be a currentIndex of 0 and therefore a current Item. It should honor the currentIndex == -1 and therefore not manipulate the currentIndex at that time.

      This causes problems in my app because the ListView auto-update to currentIndex 0 comes at a time which stomps the manual index I wished to set based on another parameter value, and often it is non-zero.

      Isn't the the currentIndex setting of -1 not supposed to be overridden automatically by the widget?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            vstevenp Steve Pavao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes