I thought when a widget in main dialog get focus, then press key, the QKeyEvent should be handled by qApp, then forward to the focused widget.
This is almost correct.
The system key event is handled by QApplication, but that event is not yet a QEeyEvent.
QApplication will create and dispatch a QKeyEvent if there is a widget that has to handle it (at least that is the way I understand it).
You might want to use QCoreApplication::winEventFilter().
And you might want to read about QAbstractEventDispatcher.