C++ QKeySequence::退出快捷方式在Windows中不工作

C++ QKeySequence::退出快捷方式在Windows中不工作,c++,windows,qt,C++,Windows,Qt,我试图为退出操作添加快捷方式。但是,它没有显示在菜单中 代码如下: exitAct = new QAction(tr("&Exit"), this); exitAct->setShortcuts(QKeySequence::Quit); exitAct->setStatusTip(tr("Exit the application")); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); 我在打印快

我试图为退出操作添加快捷方式。但是,它没有显示在菜单中

代码如下:

exitAct = new QAction(tr("&Exit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));    
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
我在打印快捷方式上尝试了同样的方法,但效果很好,所以我看不出我做错了什么。有人知道如何使用ix吗?

注意,对于Mac OS X,Ctrl+Q被分配给QKeySequence::Quit,但对于Windows则没有。对于Windows,没有为QKeySequence::Quit分配键盘快捷键

Qt文档的屏幕截图:


谢谢,我以为Ctrl+Q也适用于windows。没问题,我编辑了你的问题并用windows标记了它。