QChildEvent Class Reference

[ QtCore module]

The QChildEvent class contains event parameters for child object 事件。 更多...

继承 QEvent .

方法


详细描述

The QChildEvent class contains event parameters for child object 事件。

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

在这两种情况下,依赖的子级只能是 QObject (或者,若 QObject.isWidgetType () 返回 true, a QWidget )。这是因为在 QEvent.ChildAdded case the child is not yet fully constructed; in the QEvent.ChildRemoved case it might have already been destructed.

这些事件的处理程序是 QObject.childEvent ().


方法文档编制

QChildEvent.__init__ ( self , QEvent.Type   type , QObject   child )

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

type 可以是 QEvent.ChildAdded , QEvent.ChildRemoved , QEvent.ChildPolished ,或 QEvent.ChildRemoved .

另请参阅 child ().

QChildEvent.__init__ ( self , QChildEvent )

bool QChildEvent.added ( self )

返回 true 若 type () 是 QEvent.ChildAdded ;否则 returns false.

QObject QChildEvent.child ( self )

返回被添加 (或移除) 的子级对象。

bool QChildEvent.polished ( self )

返回 true 若 type () 是 QEvent.ChildPolished ; otherwise returns false.

bool QChildEvent.removed ( self )

返回 true 若 type () 是 QEvent.ChildRemoved ;否则 returns false.