when i press one button on the widget ,I want to Simulate the keyboard like press the key "PgDn" ,it will make the IE page down ,how can i do that,dose it must use the Xlib to do that ,and can you give me some code .
when i press one button on the widget ,I want to Simulate the keyboard like press the key "PgDn" ,it will make the IE page down ,how can i do that,dose it must use the Xlib to do that ,and can you give me some code .
try this code.
read http://doc.trolltech.com/4.4/qcoreap...html#sendEvent and QKeyEvent for detailes.Qt Code:
QKeyEvent key(QEvent::KeyPress, Qt::Key_PageDown, Qt::NoModifier); QApplication::sendEvent(widget_reciver, &key); if (key.isAccepted()) { //everything is ok } else { //something wrong }To copy to clipboard, switch view to plain text mode
I find the exam in
http://www.qt-apps.org/content/show....?content=77983
Bookmarks