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

QListModel::move uses wrong argument in beginMoveRows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P5: Not important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.1
    • Fix Version/s: None
    • Component/s: Core: Item Models
    • Labels:
      None
    • Platform/s:
      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

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes