Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.14.2
-
None
-
-
2e12479e06 (qt/qtbase/dev) 2e12479e06 (qt/tqtc-qtbase/dev) a31e0e4189 (qt/qtbase/6.4) 941a623307 (qt/qtbase/6.3) 941a623307 (qt/tqtc-qtbase/6.3) a31e0e4189 (qt/tqtc-qtbase/6.4) 48c842ce3d (qt/tqtc-qtbase/6.2)
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
For Gerrit Dashboard: QTBUG-85474 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
417146,2 | QGraphicsScene: respect that items can override selection changes | dev | qt/qtbase | Status: MERGED | +2 | 0 |
417452,2 | QGraphicsScene: respect that items can override selection changes | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
417453,2 | QGraphicsScene: respect that items can override selection changes | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
417478,2 | QGraphicsScene: respect that items can override selection changes | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |