我已经完成了搜索,并且我能找到的最接近的结果是使用QShortcut和QKeySequence组合,如下所示:self.keybindShiftEnter= QShortcut(QKeySequence("Shift+Return"), self)
# Connect the shortcut event to a lambda which executes
但是,目前我使用QShortcut来触发按钮(例如:QtCore.Qt.Key_Return),但是该按钮似乎不受qss的影响。affected by qss (QPushButton:pressed) when using Enter key)
send_message_shortcut = QtWidgets.QShortcut