QChildEvent Class

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

头文件: #include <QChildEvent>
qmake: QT += core
基类: QEvent

公有函数

QChildEvent(Type type, QObject *child)
bool added() const
QObject *child() const
bool polished() const
bool removed() const
  • 6 个公有函数继承自 QEvent

其他继承的成员

  • 1 个属性继承自 QEvent
  • 1 个静态公有成员继承自 QEvent

详细描述

The QChildEvent class contains event parameters for child object events.

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

In both cases you can only rely on the child being a QObject (or, if QObject::isWidgetType() returns true, a QWidget). This is because in the QEvent::ChildAdded case the child is not yet fully constructed; in the QEvent::ChildRemoved case it might have already been destructed.

The handler for these events is QObject::childEvent().

成员函数

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

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

type can be QEvent::ChildAdded, QEvent::ChildRemoved, or QEvent::ChildPolished.

参见 child().

bool QChildEvent::added() const

Returns true if type() is QEvent::ChildAdded; otherwise returns false.

QObject *QChildEvent::child() const

Returns the child object that was added or removed.

bool QChildEvent::polished() const

Returns true if type() is QEvent::ChildPolished; otherwise returns false.

bool QChildEvent::removed() const

Returns true if type() is QEvent::ChildRemoved; otherwise returns false.