QChildEvent#

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

Inheritance diagram of PySide6.QtCore.QChildEvent

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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 isWidgetType() returns true, a QWidget). This is because in the ChildAdded case the child is not yet fully constructed; in the ChildRemoved case it might have already been destructed.

The handler for these events is childEvent() .

class PySide6.QtCore.QChildEvent(type, child)#

PySide6.QtCore.QChildEvent(arg__1)

Parameters:

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

type can be ChildAdded , ChildRemoved , or ChildPolished .

See also

child()

PySide6.QtCore.QChildEvent.added()#
Return type:

bool

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

PySide6.QtCore.QChildEvent.child()#
Return type:

PySide6.QtCore.QObject

Returns the child object that was added or removed.

PySide6.QtCore.QChildEvent.polished()#
Return type:

bool

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

PySide6.QtCore.QChildEvent.removed()#
Return type:

bool

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