Sur cette page

QChildEvent Class

La classe `QChildEvent` contient les paramètres d'événement pour les événements des objets enfants. En savoir plus...

En-tête : #include <QChildEvent>
CMake : find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake : QT += core
Hérite de : QEvent

Fonctions publiques

QChildEvent(QEvent::Type type, QObject *child)
bool added() const
QObject *child() const
bool polished() const
bool removed() const

Fonctions protégées

QChildEvent(QChildEvent &&)
QChildEvent &operator=(QChildEvent &&)
QChildEvent &operator=(const QChildEvent &other)

Description détaillée

Les événements enfants sont envoyés immédiatement aux objets lorsque des enfants sont ajoutés ou supprimés.

Dans les deux cas, vous ne pouvez compter que sur le fait que l’enfant soit un ` QObject ` (ou, si ` QObject::isWidgetType()` renvoie ` true`, un ` QWidget`). En effet, dans le cas ` QEvent::ChildAdded `, l’enfant n’est pas encore entièrement construit ; dans le cas ` QEvent::ChildRemoved `, il a peut-être déjà été détruit.

Le gestionnaire de ces événements est ` QObject::childEvent()`.

Documentation des fonctions membres

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

Crée un objet événement enfant d'une type spécifique pour l'child.

type Peut être QEvent::ChildAdded, QEvent::ChildRemoved ou QEvent::ChildPolished.

Voir également child().

[protected delete] QChildEvent::QChildEvent(QChildEvent &&)

Crée par « move » une instance de ` QChildEvent`. Cette fonction est supprimée.

bool QChildEvent::added() const

Renvoie « true » si « type() » est « QEvent::ChildAdded » ; sinon, renvoie « false ».

QObject *QChildEvent::child() const

Renvoie l'objet enfant qui a été ajouté ou supprimé.

bool QChildEvent::polished() const

Renvoie « true » si « type() » est « QEvent::ChildPolished » ; sinon, renvoie « false ».

bool QChildEvent::removed() const

Renvoie « true » si « type() » renvoie « QEvent::ChildRemoved » ; sinon, renvoie « false ».

[protected delete] QChildEvent &QChildEvent::operator=(QChildEvent &&)

La commande « Move » affecte la fonction other à cette instance QChildEvent. Cette fonction est supprimée.

[noexcept protected default] QChildEvent &QChildEvent::operator=(const QChildEvent &other)

Copie et attribue other à cette instance de QChildEvent.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.