Hi,
I have a widget stack and one of the widgets inside contains a menu with QActions that have keyboard shortcuts to activate them.
When the widget is not visible in the stack, the shortcuts do not work, but I would like them to work.
I have tried redirecting the QEvent::Accel events that get to the main view class to the stacked widget and/or to the menu, but none of the options work.
bool main_view
::event(QEvent* e
) {
bool rv;
switch(e->type())
{
default:
break;
{
}
}
...
bool main_view::event(QEvent* e)
{
bool rv;
switch(e->type())
{
default:
rv = QMainWindow::event(e);
break;
case QEvent::Accel:
case QEvent::AccelOverride:
{
QApplication::sendEvent( stacked_widget, e );
}
}
...
To copy to clipboard, switch view to plain text mode
Any ideas of how I could achieve it?
Bookmarks