I need to simulate "Enter" key event in Qt. How can I do this?
The correct answer might be this:
QKeyEvent *event = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier); QCoreApplication::postEvent (receiver, event);
in fact there are no matching function for call to
QtKeyEvent::QtKeyEvent(Type type, int key)
but there is:
QtKeyEvent::QtKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With