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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes