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

QML GridView crashes in itemsInserted when item removed during refill

    XMLWordPrintable

Details

    Description

      void QDeclarativeGridView::itemsInserted(int modelIndex, int count) maintains list of grid items QList<FxGridItem*> added; void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer) called from setCurrentIndex(0), ... may remove an item under certain circumstances (visibleItems.removeLast(). In consequence access to the already destroyed instance is performed. Consider drop the QList<FxGridItem*> added; in the void QDeclarativeGridView::itemsInserted(int modelIndex, int count) and following modification at the same time

      // everything is in order now - emit add() signal
      //for (int j = 0; j < added.count(); ++j)
      // added.at(j)>attached>emitAdd(); //There is a problem
      for (int j = 0; j < d->visibleItems.count(); ++j)
      d->visibleItems.at(j)>attached>emitAdd();

      Attachments

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

        Activity

          People

            andysh Andy Shaw
            hrdlimar Martin Hrdlicka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes