Hi Everybody,
I am working with qt3.3.8b.
I add a QKeyEvent as describe below:
....
QKeyEvent kev
(QEvent::KeyPress, Qt
::Key_F1,
0, Qt
::NoButton,
NULL,
false,
1);
.....
....
QWidget* targetWidget = QApplication::focusWidget();
QKeyEvent kev(QEvent::KeyPress, Qt::Key_F1, 0, Qt::NoButton, NULL, false, 1);
QApplication::sendEvent(targetWidget, &kev);
.....
To copy to clipboard, switch view to plain text mode
It works fine on the main widget::keyPressEvent(QKeyEvent *k), i can receive
the key, also the QLineEdit are working fine.
With the QBushButton even if i define setAccel(Qt::Key_F1), there is no way to works out.
If i press F1 on the keybord the button works but it does not calling the sendEvent.
Is there anybody can give me a typ about that?
Thanks in advance
Ezio
Bookmarks