ui->pushButton_login->setFocus(); // 设置默认焦点
ui->pushButton_login->setShortcut(QKeySequence::InsertParagraphSeparator);
ui->pushButton_login->setShortcut(Qt::Key_Enter);
ui->pushButton_login->setShortcut(Qt::Key_Return);标签:pushButton,setShortcut,ui,QPushButton,Enter,login,链接 From: https://www.cnblogs.com/QinXian/p/17118236.html