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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.x
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Platform/s:
      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

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes