Safe Haskell | None |
---|---|
Language | Haskell2010 |
General routines for managing QEvent
s.
Synopsis
- class SceneEvent e => Event e where
- data EventRegistration
- unregister :: EventRegistration -> IO ()
- type EventFilter = QObject -> QEvent -> IO Bool
- onAnyEvent :: QObjectPtr target => target -> EventFilter -> IO EventRegistration
- internalRegistrationIsLive :: EventRegistration -> IO Bool
High-level interface.
class SceneEvent e => Event e where Source #
A typeclass for Qt event classes (subclasses of QEvent
).
onEvent :: QObjectPtr this => this -> (e -> IO Bool) -> IO EventRegistration Source #
Registers a callback function to be invoked when an event of type e
is
sent to an object. This is a wrapper around onAnyEvent
, so for details,
see that function; all comments about EventFilter
s apply equally to
handlers given here.
Instances
data EventRegistration Source #
A record that an event handler was registered with a receiver object. This
can be given to unregister
to destroy the corresponding handler.
unregister :: EventRegistration -> IO () Source #
Disconnects an event handler and frees its resources. This function is idempotent.
Low-level interface
type EventFilter = QObject -> QEvent -> IO Bool Source #
An filter that can handle any type of event.
onAnyEvent :: QObjectPtr target => target -> EventFilter -> IO EventRegistration Source #
Registers an EventFilter
to listen to events that a QObject
receives.
A filter can return false to allow the event to propagate further, or true to
indicate that the event has been handled, and stop propagation. When
multiple filters are attached to an object, the last one installed is called
first. The filter will stay active until the receiver is deleted, or
unregister
is called.
This function uses installEventFilter
under the hood.