nrabara
18th May 2010, 13:36
Hi,
I am using qt/embedded on Custom ARM platform. I have used QListWidget to display wallpapers in thumbnail view.
I have few navigation keys on my board which I want to use as key event.
How to send Key_Left/Key_Right keypress event to ListWidget?
I know how to get event, by using customising keyPressEvent as below in code.
void Widget::keyPressEvent(QKeyEvent * event)
{
switch(event->key())
{
case Qt::Key_Left;
qDebug()<<"Key_Left";
break;
case Qt::Key_Right;
qDebug()<<"Key_Right";
break;
default:
break;
}
event->accept();
}
But I dont know how to post KeyPressEvent (Key_Left/Key_Right).
I can post key-press event by using QCoreApplication::PostEvent, but how to post Key_Left event instead of keyPressed/keyReleased .
Any suggestion would be appreciable.
I am using qt/embedded on Custom ARM platform. I have used QListWidget to display wallpapers in thumbnail view.
I have few navigation keys on my board which I want to use as key event.
How to send Key_Left/Key_Right keypress event to ListWidget?
I know how to get event, by using customising keyPressEvent as below in code.
void Widget::keyPressEvent(QKeyEvent * event)
{
switch(event->key())
{
case Qt::Key_Left;
qDebug()<<"Key_Left";
break;
case Qt::Key_Right;
qDebug()<<"Key_Right";
break;
default:
break;
}
event->accept();
}
But I dont know how to post KeyPressEvent (Key_Left/Key_Right).
I can post key-press event by using QCoreApplication::PostEvent, but how to post Key_Left event instead of keyPressed/keyReleased .
Any suggestion would be appreciable.