I would like to send a Qt::Key\_Left signal to my app from a thread.   

I tried to send my event with the following code but nothing happens :   

`QKeyEvent *event = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier);
QCoreApplication::sendEvent (app, pressEvent);`  

Actually, these functions are called from a thread that was listening on a port. Is that possible the problem is caused by the fact that these functions are not called from the main thread ?  

I just let you know that my app is in QML (don't know if it changes something). I also tried with the static function `QCoreApplication::postEvent`

Thank you in advance.
Sorry for my english level.