Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
automatic key ?
how to automatic press a key in Qt5.///
Its a little vague what you want to do :)
You mean press a key in your own app for some other app ?
i just want to automatic reload and display infomation to a widget by Key_F5 but not touch F5 .
well you can try sending it a key event (up and down events)
QKeyEvent * eve1 = new QKeyEvent (QEvent::KeyPress,Qt::Key_F5,Qt::NoModifier,"F5"); QKeyEvent * eve2 = new QKeyEvent (QEvent::KeyRelease,Qt::Key_F5,Qt::NoModifier,"F5"); qApp->postEvent((QObject*)ui->thewidget,(QEvent *)eve1); qApp->postEvent((QObject*)ui->thewidget,(QEvent *)eve2);
Does F5 normally call your own code or is it a widget HTML browser and it is its code ?
in picture 1, i will change information and after picture 1 closed, I want picture 2 automatic update information. How I o=do it ?
Looks like picture 2 is a dialog, so if you are using exec, just update the content of picture 1 and it will be refreshed automatically.
Other than that, you should provide more information about what is picture 1.
nagesh last edited by
@Duy-Khang It all depends on how the picture-2 data is populated?
if this information is through database of student? then ,
in picture-1 you are having "Update" button right? Store the updated information into database first and reload the picture-2 to reflect that data is updated.