代码如下
void Window::setupAction(){
newAction = new QAction(tr("&New"), this);
newAction->setIcon(QIcon(":/images/new.png"));
newAction->setShortcut(QKeySequence(tr("Ctrl+N")));
newAction->setStatusTip(tr("Create a new spreadsheet file"));
QObject::connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));
dbTreeShowHideAction=new QAction(tr("&dbTreeShowHide"),this);
dbTreeShowHideAction->setShortcut(QKeySequence(tr("Ctrl+M")));
QObject::connect(dbTreeShowHideAction,SIGNAL(triggered()),this,SLOT(showHideDBTree()));
}
newAction的shortcut其效果,但是dbTreeShowHideAction的SetShortCut却是无效的,求帮助!求帮助
谢谢大家了!