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

rowsInserted first and last argument inverted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.10.1
    • Widgets: Itemviews
    • None

    Description

      I have a child of an QAbstractListModel that appends a row using 

      beginInsertRows( QModelIndex(), rowCount(QModelIndex()), rowCount(QModelIndex()) );

      DebugSrc->addTheMessage( D );

      endInsertRows();

      where DebugSrc is a QList< SomeClass> that stores the data

      I have a Qsortfilterproxymodel attached to this model which in turn is used in a widget that contains a view.

      That widget connects to the QSortFilterProxyModels' rowsInserted signal like

      connect( SFPModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)) ); 

      where 'this' is an instance of the TraceView class (see below)

      the signal does some stuff based on the first last index like

      while( last >= first ) {

        last --;

      }

      and it fails. (endless loop)

      I attached to the running process and used a 'bt' in gdb and I saw this 

      #9  0x0000562f3514c10c in TraceView::rowsInserted (this=0x7fcdb400b650, first=1507, last=1506) at ../../../DebugAnalyzer/Analyzer/traceview.cpp:379

      See the values of first and last ???

      weird ??? is this correct ????

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            u19809 wim delvaux
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes