对于如下这种错误:
QAction::eventFilter: Ambiguous shortcut overload: F5
一个规避方法如下:
I was able to work around this by setting the shortcut context for my close action. By setting it to Qt::WidgetShortcut
, I no longer get the ambiguous shortcut overload. Here is how I'm setting up my close action now:
closeAction = new QAction(tr("&Close"), this);
closeAction->setShortcut(Qt::CTRL|Qt::Key_W);
closeAction->setShortcutContext(Qt::WidgetShortcut);
connect(closeAction, SIGNAL(triggered()), mdiArea, SLOT(closeActiveSubWindow()));