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.
{
}
void MyAction
::keyPressEvent(QKeyEvent *event
) {
unsigned int keyId;
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;
}
}
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;
}
}
To copy to clipboard, switch view to plain text mode
Thanks in Advance
Bookmarks