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

我试图添加退出操作的快捷方式。 但是它不会显示在菜单中。

代码如下:

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文档截图:

在这里输入图像说明