最近在开发过程中,遇到对系统休眠有要求,查看帮助文档,有了点发现:
[virtual protected]bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)
This special event handler can be reimplemented in a subclass to receive native platform events identified by eventType which are passed in the message parameter.
In your reimplementation of this function, if you want to stop the event being handled by Qt, return true and set result. If you return false, this native event is passed back to Qt, which translates the event into a Qt event and sends it to the widget.
Note: Events are only delivered to this event handler if the widget is has a native Window handle.
Note: This function superseedes the event filter functions x11Event(), winEvent() and macEv