QChildEvent 类

The QChildEvent class contains event parameters for child object events. 更多...

头: #include <QChildEvent>
继承: QEvent

公共函数

QChildEvent (Type type , QObject * child )
bool 添加 () const
QObject * child () const
bool polished () const
bool removed () const

额外继承成员

详细描述

The QChildEvent class contains event parameters for child object events.

子级事件会被立即发送给对象,当子级被添加 (或移除) 时。

在这两种情况下,依赖的子级只能是 QObject (或者,若 QObject::isWidgetType () returns true, a QWidget )。这是因为在 QEvent::ChildAdded 情况下,子级尚未被完全构造;在 QEvent::ChildRemoved 情况下,它可能已被销毁。

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

成员函数文档编制

QChildEvent:: QChildEvent ( Type type , QObject * child )

构造子级事件对象为特定 type child .

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

另请参阅 child ().

bool QChildEvent:: 添加 () const

返回 true 若 type () 是 QEvent::ChildAdded ;否则返回 false。

QObject * QChildEvent:: child () const

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

bool QChildEvent:: polished () const

返回 true 若 type () 是 QEvent::ChildPolished ;否则返回 false。

bool QChildEvent:: removed () const

返回 true 若 type () 是 QEvent::ChildRemoved ;否则返回 false。