How to stop spacebar from triggering a focused QPushButton?
问题 Suppose I have a focused QPushButton : my_button = new QPushButton("Press me!", this); my_button->setFocus(); When this button is displayed, pressing Space will trigger (i.e. click) the button. I don't want this behavior. Instead, I would like Ctrl + Enter to trigger the button. How can I achieve this in Qt? (Working examples would really help as this is part of my first Qt app) 回答1: I think the best way is to do as @thuga said. The idea is to subclass the QPushButton and reimplement