How can I let users use control + + for zoom in and control + - for zoom out?
问题 The problem with my code below is that on US/UK keyboard layouts + is generated with shift + = , but when the user uses both the control and shift modifiers simultaneously, + is not generated. This has been tested on Mac. Keys.onPressed: { if (event.modifiers & Qt.ControlModifier) { if (event.key === Qt.Key_Minus) { zoom(false) event.accepted = true } else if (event.key === Qt.Key_Plus) { zoom(true) event.accepted = true } } } Since control + + and control + - are standard shortcuts for