The QChildEvent class contains event parameters for child object events. More...
Header: | #include <QChildEvent> |
CMake: | find_package(Qt6 COMPONENTS Core REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
Inherits: | QEvent |
QChildEvent(QEvent::Type type, QObject *child) | |
bool | added() const |
QObject * | child() const |
bool | polished() const |
bool | removed() const |
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().
Constructs a child event object of a particular type for the child.
type can be QEvent::ChildAdded, QEvent::ChildRemoved, or QEvent::ChildPolished.
See also child().
Returns true
if type() is QEvent::ChildAdded; otherwise returns false.
Returns the child object that was added or removed.
Returns true
if type() is QEvent::ChildPolished; otherwise returns false.
Returns true
if type() is QEvent::ChildRemoved; otherwise returns false.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qchildevent.html