QChildEvent Class Reference

#include <qcoreevent.h>

Inheritance diagram for QChildEvent:

Inheritance graph
[legend]
Collaboration diagram for QChildEvent:

Collaboration graph
[legend]
List of all members.

Detailed Description

The QChildEvent class contains event parameters for child object events.

Child events are sent immediately to objects when children are added or removed.

In both cases you can only rely on the child being a QObject (or, if QObject::isWidgetType() returns true, a QWidget). This is because in the QEvent::ChildAdded case the child is not yet fully constructed; in the QEvent::ChildRemoved case it might have already been destructed.

The handler for these events is QObject::childEvent().

Definition at line 264 of file qcoreevent.h.

Public Member Functions

 QChildEvent (Type type, QObject *child)
 ~QChildEvent ()
QObjectchild () const
bool added () const
bool polished () const
bool removed () const

Protected Attributes

QObjectc


Constructor & Destructor Documentation

QChildEvent::QChildEvent ( Type  type,
QObject child 
)

Constructs a child event object of a particular type for the child.

type can be QEvent::ChildAdded, QEvent::ChildRemoved, QEvent::ChildPolished, or QEvent::ChildRemoved.

See also:
child()

Definition at line 362 of file qcoreevent.cpp.

00363     : QEvent(type), c(child)
00364 {}

QChildEvent::~QChildEvent (  ) 

Definition at line 368 of file qcoreevent.cpp.

00369 {
00370 }


Member Function Documentation

QObject * QChildEvent::child (  )  const [inline]

Returns the child object that was added or removed.

Definition at line 269 of file qcoreevent.h.

References c.

Referenced by Q3MainWindow::childEvent(), QWorkspaceChild::childEvent(), Q3WidgetStack::childEvent(), QWorkspace::childEvent(), Q3ActionGroup::childEvent(), QHideDock::childEvent(), and QtWindowListMenu::eventFilter().

00269 { return c; }

bool QChildEvent::added (  )  const [inline]

Returns true if type() is QEvent::ChildAdded; otherwise returns false.

Definition at line 270 of file qcoreevent.h.

References QEvent::type().

00270 { return type() == ChildAdded; }

Here is the call graph for this function:

bool QChildEvent::polished (  )  const [inline]

Returns true if type() is QEvent::ChildPolished; otherwise returns false.

Definition at line 274 of file qcoreevent.h.

References QEvent::type().

00274 { return type() == ChildPolished; }

Here is the call graph for this function:

bool QChildEvent::removed (  )  const [inline]

Returns true if type() is QEvent::ChildRemoved; otherwise returns false.

Definition at line 275 of file qcoreevent.h.

References QEvent::type().

Referenced by Q3WidgetStack::childEvent(), QWorkspace::childEvent(), and Q3ActionGroup::childEvent().

00275 { return type() == ChildRemoved; }

Here is the call graph for this function:


Member Data Documentation

QObject* QChildEvent::c [protected]

Definition at line 277 of file qcoreevent.h.


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 16:58:33 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1