@Christian-Ehrlicher Thank you for your reply, it is helpful to me. In addition, I would like to ask another question. If I want to filter this way, I only want the main window to receive messages, but I don't want the child window control QWidget to receive messages. Can this be achieved? Or can it only be achieved by overloading the nativeEvent function on QMainWindow? Hope your reply