Safe Haskell | None |
---|---|
Language | Haskell2010 |
General routines for managing events for Graphics.UI.Qtah.Widgets.QGraphicsScenes.
Synopsis
- class SceneEvent e where
- data SceneEventRegistration
- unregister :: SceneEventRegistration -> IO ()
- type SceneEventFilter = QGraphicsItem -> QEvent -> IO Bool
- onAnySceneEvent :: QGraphicsItemPtr target => target -> SceneEventFilter -> IO SceneEventRegistration
- internalRegistrationIsLive :: SceneEventRegistration -> IO Bool
High-level interface.
class SceneEvent e where Source #
A typeclass for Qt events within a
QGraphicsScene
.
onSceneEvent :: QGraphicsItemPtr this => this -> (e -> IO Bool) -> IO SceneEventRegistration Source #
Registers a callback function to be invoked when an event of type e
is
sent to an object. This is a wrapper around onAnySceneEvent
, so for details,
see that function; all comments about SceneEventFilter
s apply equally to
handlers given here.
Instances
data SceneEventRegistration 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 :: SceneEventRegistration -> IO () Source #
Disconnects an event handler and frees its resources. This function is idempotent.
Low-level interface
type SceneEventFilter = QGraphicsItem -> QEvent -> IO Bool Source #
An filter that can handle any type of event.
onAnySceneEvent :: QGraphicsItemPtr target => target -> SceneEventFilter -> IO SceneEventRegistration Source #
Registers an SceneEventFilter
to listen to events that a QGraphicsItem
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 installSceneEventFilter
under the hood.