I\'m injecting Keyboard and Mouse events which are comming over the network into my Qt Application and use QCoreApplication::postEvent for this. The mouse coord
Can you use QApplication::widgetAt() to find the correct widget at the position and then post to that?
QPoint pos(x, y);
QMouseEvent *event = new QMouseEvent(type, pos, mouse_button, mouse_buttons, Qt::NoModifier);
QWidget *receiver = QApplication::widgetAt(pos);
QCoreApplication::postEvent(receiver, event);
I wouldn't expect that you would have to do this for the key events though. They should be sent to the focused widget (QApplication::focusWidget()).
Unfortunately, I haven't tested any of this.