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.

子級事件會被立即發送給對象,當子級被添加 (或移除) 時。

在這 2 種情況下,隻能依賴的子級是 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。