KTutorial  0.5.1
Signals | Public Member Functions | Protected Member Functions
ktutorial::editorsupport::EventSpy Class Reference

Spy to know all the events received in an object hierarchy. More...

#include <EventSpy.h>

List of all members.

Signals

void eventReceived (QObject *object, QEvent *event)
 Emitted when an event is received in any of the spied objects or their children.

Public Member Functions

 EventSpy (QObject *parent=0)
 Creates a new EventSpy with the given parent.
void addObjectToSpy (QObject *object)
 Add object and all its children to spy.

Protected Member Functions

virtual bool eventFilter (QObject *object, QEvent *event)
 Filters the events received in the spied object hierarchies.

Detailed Description

Spy to know all the events received in an object hierarchy.

EventSpy emitts a signal whenever an event is received in any of the spied objects or its children (recursively). Even children added to a spied object after it was added are spied.

Definition at line 33 of file EventSpy.h.


Constructor & Destructor Documentation

ktutorial::editorsupport::EventSpy::EventSpy ( QObject *  parent = 0) [explicit]

Creates a new EventSpy with the given parent.

Parameters:
parentThe parent QObject.

Definition at line 28 of file EventSpy.cpp.


Member Function Documentation

Add object and all its children to spy.

Parameters:
objectThe object to spy.

Definition at line 31 of file EventSpy.cpp.

Referenced by ktutorial::editorsupport::EditorSupport::enableEventSpy(), and eventFilter().

bool ktutorial::editorsupport::EventSpy::eventFilter ( QObject *  object,
QEvent *  event 
) [protected, virtual]

Filters the events received in the spied object hierarchies.

A eventReceived(QObject*, QEvent*) is emitted for each event.

Parameters:
objectThe object that received the event.
eventThe event received.
Returns:
False, the let events be handled as necessary.

Definition at line 41 of file EventSpy.cpp.

References addObjectToSpy(), and eventReceived().

void ktutorial::editorsupport::EventSpy::eventReceived ( QObject *  object,
QEvent *  event 
) [signal]

Emitted when an event is received in any of the spied objects or their children.

Parameters:
objectThe object that received the event.
eventThe event received.

Referenced by eventFilter().


The documentation for this class was generated from the following files: