qtah-qt5-0.3.0: Qt bindings for Haskell

Safe HaskellNone
LanguageHaskell2010

Graphics.UI.Qtah.SceneEvent

Contents

Description

General routines for managing events for Graphics.UI.Qtah.Widgets.QGraphicsScenes.

Synopsis

High-level interface.

class SceneEvent e where Source #

A typeclass for Qt events within a QGraphicsScene.

Minimal complete definition

onSceneEvent

Methods

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 SceneEventFilters apply equally to handlers given here.

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.

Internal