qtah-qt5-0.3.0: Qt bindings for Haskell

Safe HaskellNone
LanguageHaskell2010

Graphics.UI.Qtah.Event

Contents

Description

General routines for managing QEvents.

Synopsis

High-level interface.

class SceneEvent e => Event e where Source #

A typeclass for Qt event classes (subclasses of QEvent).

Minimal complete definition

onEvent

Methods

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

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.

Internal