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

Qt6 regression in QGraphicsScene due to QList refactoring: removeItem() is no more a constant time operation in a scene with no index

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.0.0
    • Widgets: GraphicsView
    • None
    • Any platform
    • All

      Hi,

      In Qt5, QGraphicsScene::removeItem() was a constant time operation when the index method was set to 'NoIndex', as stated in the documentation. This efficiency was due to the method QGraphicsSceneLinearIndex::removeItem() which simply removed the indexed items from a QList (constant time operation in Qt5).

      Now in Qt6, removing an item from a QList is not a constant time operation any more (due to the QList refactoring). As a consequence, QGraphicsSceneLinearIndex should store indexed items in another container than a QList (like std::list for instance) in order to recover an efficient removeItem() method as it was in Qt5.

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

            bibr Andreas Aardal Hanssen
            floc Flo C
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes