Priority: P3: Somewhat important
Affects Version/s: 5.6.3, 5.12
Fix Version/s: None
Component/s: Widgets: GraphicsView
This bug can be reproduced using the 40000 Chips QT example, but changing this line in chip.cpp:
setFlags(ItemIsSelectable | ItemIsMovable);
After that, any selected items are cleared on right clicking with the mouse.
However, one thing that was not informed in the previous bug reports, or documented anywhere, is that it only happens if QGraphicsItem::ItemIsMovable is set to false.
This is a non expected behaviour when QGraphicsItem::ItemIsSelectable is set to true.
In my case I have non movable items where I would like to add actions to the selected items on right click. And as of today it is impossible unless I do some ugly hacking.
The workaround described here (https://www.qtcentre.org/threads/36953-QGraphicsItem-deselected-on-contextMenuEvent) does not work perfectly for me since selectedItems() and focusItem() are not updated.