my mistake this will not work for QCoreApplication. (as nothing will send key event to QCoreApplication)
You need to read stdin explicitly using C / C++ calls fscanf(), cin directly from main (before entering event loop), or write a console reader thread (inherit QThread) and read the stdin in the thread and do the required.
Bookmarks