PDA

View Full Version : Navigation in submenu and QAction



Ratheendrans
18th November 2011, 06:36
Dear All,

I problem is with embedded system environment,I inherit QAction and instances of it is created as submenus for navigation purpose.I want to navigate to other submenu with the keypress event,In other cases where I subclass QWidget related class I was able to use focusNextChild,focusPreviousChild for navigation.How can I achieve the same with QObject subclasses.

I hope this message will be more clear with the code below.



MyAction::MyAction( const QString & text, QObject * parent ):QAction(text,parent)
{

}


void MyAction::keyPressEvent(QKeyEvent *event)
{
unsigned int keyId;
QString ch("");
switch (event->key())
{
case Qt::Key_Right:
printf("Use Qt::Key_Right\n");
//I Used focusNextChild() for QWidget Subclasses
break;
case Qt::Key_Left:
//I Used focusPreviousChild() for QWidget Subclasses
break;
}
}



Thanks in Advance