PDA

View Full Version : Key shortcuts for not visible widgets



trskel
21st March 2007, 15:35
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:
rv = QMainWindow::event(e);
break;
case QEvent::Accel:
case QEvent::AccelOverride:
{
QApplication::sendEvent( stacked_widget, e );
}
}
...

Any ideas of how I could achieve it?

trskel
26th March 2007, 10:02
Still no luck. Anyone can help please?