QtBase
v6.3.1
|
The QChildEvent class contains event parameters for child object events. More...
#include <qcoreevent.h>
Public Member Functions | |
QChildEvent (Type type, QObject *child) | |
~QChildEvent () | |
QObject * | child () const |
bool | added () const |
bool | polished () const |
bool | removed () const |
QChildEvent * | clone () const override |
Public Member Functions inherited from QEvent | |
QEvent (Type type) | |
virtual | ~QEvent () |
Type | type () const |
bool | spontaneous () const |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
void | ignore () |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
Protected Attributes | |
QObject * | c |
Protected Attributes inherited from QEvent | |
quint16 | t |
The QChildEvent class contains event parameters for child object events.
\inmodule QtCore
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().
Definition at line 382 of file qcoreevent.h.
Constructs a child event object of a particular type for the child.
type can be QEvent::ChildAdded, QEvent::ChildRemoved, or QEvent::ChildPolished.
Definition at line 604 of file qcoreevent.cpp.
QChildEvent::~QChildEvent | ( | ) |
Definition at line 611 of file qcoreevent.cpp.
|
inline |
Returns true
if type() is QEvent::ChildAdded; otherwise returns false.
Definition at line 389 of file qcoreevent.h.
|
inline |
Returns the child object that was added or removed.
Definition at line 388 of file qcoreevent.h.
|
inlineoverridevirtual |
Creates and returns an identical copy of this event.
Reimplemented from QEvent.
Definition at line 393 of file qcoreevent.h.
|
inline |
Returns true
if type() is QEvent::ChildPolished; otherwise returns false.
Definition at line 390 of file qcoreevent.h.
|
inline |
Returns true
if type() is QEvent::ChildRemoved; otherwise returns false.
Definition at line 391 of file qcoreevent.h.
|
protected |
Definition at line 396 of file qcoreevent.h.