KTutorial
0.5.1
|
Spy to know all the events received in an object hierarchy. More...
#include <EventSpy.h>
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. |
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.
ktutorial::editorsupport::EventSpy::EventSpy | ( | QObject * | parent = 0 | ) | [explicit] |
Creates a new EventSpy with the given parent.
parent | The parent QObject. |
Definition at line 28 of file EventSpy.cpp.
void ktutorial::editorsupport::EventSpy::addObjectToSpy | ( | QObject * | object | ) |
Add object and all its children to spy.
object | The 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.
object | The object that received the event. |
event | The event received. |
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.
object | The object that received the event. |
event | The event received. |
Referenced by eventFilter().