PDA

View Full Version : emit key events



ruben.rodrigues
5th July 2011, 15:51
Hi all!

I have a application that I want to fully use as touchscreen "frendly". I have a tableWidget and a numpad on the right side. I removed the focus from the numpad key such that when I press them I don't lose the focus on the table items.

I still didn't figured out how to emit the keys and so far I have this:

on a slot connected to the button 1:


QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_1, Qt::KeypadModifier, 0);
QApplication::postEvent(this, event);