The QChildEvent class contains event parameters for child object events. 更多...
| 頭: | #include <QChildEvent> |
| qmake: | QT += core |
| 繼承: | QEvent |
| QChildEvent (QEvent::Type type , QObject * child ) | |
| bool | added () const |
| QObject * | child () const |
| bool | polished () const |
| bool | removed () const |
| QObject * | c |
The QChildEvent class contains event parameters for child object events.
子級事件會被立即發送給對象,當子級被添加 (或移除) 時。
在這 2 種情況下,隻能依賴的子級是
QObject
(或者,若
QObject::isWidgetType
() 返迴
true
,
QWidget
)。這是因為在
QEvent::ChildAdded
情況下,子級尚未被完全構造;在
QEvent::ChildRemoved
情況下,它可能已銷毀。
這些事件的處理程序是 QObject::childEvent ().
構造子級事件對象為特定 type 為 child .
type 可以是 QEvent::ChildAdded , QEvent::ChildRemoved ,或 QEvent::ChildPolished .
另請參閱 child ().
返迴
true
if
type
() 是
QEvent::ChildAdded
;否則返迴 false。
返迴被添加 (或移除) 的子級對象。
返迴
true
if
type
() 是
QEvent::ChildPolished
;否則返迴 false。
返迴
true
if
type
() 是
QEvent::ChildRemoved
;否則返迴 false。