File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -300,13 +300,22 @@ def sceneMousePressEvent(self, event):
300300 The event handler from the QtWidgets.QGraphicsScene
301301 """
302302 alt_modifier = event .modifiers () == QtCore .Qt .AltModifier
303- # (NOTE) Please see commit message
304- # ctrl_modifier = event.modifiers() == QtCore.Qt.ControlModifier
305- # shift_modifier = event.modifiers() == QtCore.Qt.ShiftModifier
306- # if shift_modifier:
307- # event.setModifiers(QtCore.Qt.ControlModifier)
308- # elif ctrl_modifier:
309- # event.setModifiers(QtCore.Qt.ShiftModifier)
303+
304+ # (NOTE) The `QtWidgets.QGraphicsSceneMouseEvent` class doesn't have
305+ # `setModifiers` in PyQt, and can't find a workaround for it.
306+ # So the only option to work with PyQt for now was to drop the modifier
307+ # remapping, but judging from the event passing flow and running a few
308+ # tests, it looks like those remapping code didn't have any affect to
309+ # the UI function.
310+ # Should be safe to comment out the code below.
311+ """
312+ ctrl_modifier = event.modifiers() == QtCore.Qt.ControlModifier
313+ shift_modifier = event.modifiers() == QtCore.Qt.ShiftModifier
314+ if shift_modifier:
315+ event.setModifiers(QtCore.Qt.ControlModifier)
316+ elif ctrl_modifier:
317+ event.setModifiers(QtCore.Qt.ShiftModifier)
318+ """
310319
311320 if not alt_modifier :
312321 pos = event .scenePos ()
You can’t perform that action at this time.
0 commit comments