【发布时间】:2014-06-19 08:02:45
【问题描述】:
我尝试为退出操作添加快捷方式。但是它没有显示在菜单中。
代码如下:
exitAct = new QAction(tr("&Exit"), this);
exitAct->setShortcuts(QKeySequence::Quit);
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
我为打印快捷方式尝试了同样的方法,它可以正常工作,所以我看不出我在这里做错了什么。有人知道如何修复它吗?
【问题讨论】: