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 ().
構造子級事件對象為特定 type 為 child .
type 可以是 QEvent::ChildAdded , QEvent::ChildRemoved , QEvent::ChildPolished ,或 QEvent::ChildRemoved .
另請參閱 child ().
返迴 true 若 type () 是 QEvent::ChildAdded ;否則返迴 false。
返迴被添加 (或移除) 的子級對象。
返迴 true 若 type () 是 QEvent::ChildPolished ;否則返迴 false。
返迴 true 若 type () 是 QEvent::ChildRemoved ;否則返迴 false。