Home · Modules · Classes · Namespaces · Functions

QxtNativeEventFilter Class Reference
[QxtGui module]

The QxtNativeEventFilter class provides a native event filter to access platform specific events. More...

    #include <QxtNativeEventFilter>

Public Functions


Detailed Description

The QxtNativeEventFilter class provides a native event filter to access platform specific events.

QxtNativeEventFilter provides access to platform specific native events without the need of subclassing QApplication.

Note: QxtNativeEventFilter requires QxtApplication.

Example usage:

    qxtApp->installNativeEventFilter(myObject);

    class MyObject : public QxtNativeEventFilter {
        public:
            ...

            bool x11EventFilter(XEvent* event) {
                if (event->type == ...) {
                    ...
                }
                return false;
            }

            bool winEventFilter(MSG* msg, long* result) {
                if (msg->message == ...) {
                    ...
                }
                return false;
            }

            bool macEventFilter(EventHandlerCallRef caller, EventRef event) {
                if (GetEventClass(event) == ...) {
                    ...
                }
                return false;
            }
    };

See also QxtApplication::installNativeEventFilter().


Member Function Documentation

QxtNativeEventFilter::~QxtNativeEventFilter ()   [virtual]

Destructs the native event filter. The native event filter is automatically removed from the application.

See also QxtApplication::removeNativeEventFilter().

bool QxtNativeEventFilter::macEventFilter ( EventHandlerCallRef caller, EventRef event )   [virtual]

Filters Mac events if this object has been installed as a native event filter. The events are passed in the event parameter with the caller parameter.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

See also QxtApplication::installNativeEventFilter().

bool QxtNativeEventFilter::winEventFilter ( MSG * msg, long * result )   [virtual]

Filters Windows events if this object has been installed as a native event filter. The window messages are passed in the msg parameter and the return value of the window procedure can be set to the result parameter.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

See also QxtApplication::installNativeEventFilter().

bool QxtNativeEventFilter::x11EventFilter ( XEvent * event )   [virtual]

Filters X11 events if this object has been installed as a native event filter. The events are passed in the event parameter.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

See also QxtApplication::installNativeEventFilter().


Copyright © 2007-2011 Qxt Foundation
Qxt 0.6.2