In my small project, all the Shortcuts are working fine but the Tab button is not event picked up as an event. Does anyone have any idea what might be wrong? I haven't changed anything with setFocusPolicy() etc. I have only reimplemented the
void event(QEvent * event)
{
if (event->type() == QEvent::KeyPress)
{
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
if (ke->key() == Qt::Key_M)
{
//do stuff
}
//... same for other button cases
if (ke->key() == Qt::Key_Tab)
{
// special tab handling here
return true;
}
}
else
{
return false;
}
return QWidget::event(event);
}
It is not related with the other question since the solution provided there is to reimplement the notify() function of QApplication. In my case the widget is completely decoupled with the QAppication so the solution does not apply here.