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

QListModel::move uses wrong argument in beginMoveRows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P5: Not important
    • None
    • 5.11.1
    • Core: Item Models
    • None
    • All

    Description

      QListModel::move passes dstRow to beginMoveRows but the documentation states: "However, when moving rows down in the same parent (sourceParent and destinationParent are equal), the rows will be placed before the destinationChild index. That is, if you wish to move rows 0 and 1 so they will become rows 1 and 2, destinationChild should be 3. In this case, the new index for the source row i (which is between sourceFirst and sourceLast) is equal to (destinationChild-sourceLast-1+i)."

      dstRow+1 should be passed instead

      It's the same mistake I made in https://codereview.qt-project.org/237364/

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            VRonin Luca
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes