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

QGraphicsScene::clearSelection() may leave internal state inconsistent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Platform/s:
      All

      Description

      The current implementatation of QGraphicsScene::clearSelection() has a flaw: QGraphicsItems can override setSelected() with the itemChanged() function. This is not taken into account where the internal state is modified after setSelected( false ) has been called on all items:

      foreach (QGraphicsItem *item, d->selectedItems)
          item->setSelected(false);
      d->selectedItems.clear(); // <- items may still be selected here

      So instead of just clearing the vector, it is required to determine the actually selected items.

        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:
            thippler Tobias Hippler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes