Home · All Classes · Modules

QChildEvent Class Reference
[QtCore module]

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

Inherits QEvent.

Methods


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


Method Documentation

QChildEvent.__init__ (self, QEvent.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().

QChildEvent.__init__ (self, QChildEvent)

bool QChildEvent.added (self)

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

QObject QChildEvent.child (self)

Returns the child object that was added or removed.

bool QChildEvent.polished (self)

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

bool QChildEvent.removed (self)

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


PyQt 4.12.1 for X11Copyright © Riverbank Computing Ltd and The Qt Company 2015Qt 4.8.7