快捷键在我们平常中使用十分频繁,下面提供两种设置方式 1. 使用 & 在文本前使用&, 自动会设置快捷键为 Alt + 首字母 button = QPushButton("&sign_up", window) # 会自动设置快捷键 Alt + S 2. 使用setShortcut 使用setShortcut可以自定义设置快捷键 button.setShortcut('Alt + N') # 按键 Alt + N 便可触发