CopperSpice API  1.9.1
QChildEvent Class Reference

The QChildEvent class contains event parameters for child object events. More...

Inheritance diagram for QChildEvent:
QEvent

Public Methods

 QChildEvent (Type type, QObject *child)
 
bool added () const
 
QObjectchild () const
 
bool polished () const
 
bool removed () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Public Types inherited from QEvent
enum  Type
 
- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

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().

See also
child()

Constructor & Destructor Documentation

QChildEvent::QChildEvent ( Type  type,
QObject child 
)

Constructs a child event object of a particular type for the child. The type can be QEvent::ChildAdded, QEvent::ChildRemoved, QEvent::ChildPolished, or QEvent::ChildRemoved.

See also
child()

Method Documentation

bool QChildEvent::added ( ) const
inline

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

QObject * QChildEvent::child ( ) const
inline

Returns the child object that was added or removed.

bool QChildEvent::polished ( ) const
inline

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

bool QChildEvent::removed ( ) const
inline

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