In questa pagina

QChildEvent Class

La classe QChildEvent contiene i parametri relativi agli eventi degli oggetti figli. Per saperne di più...

Intestazione: #include <QChildEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Eredita da: QEvent

Funzioni pubbliche

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

Funzioni protette

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

Descrizione dettagliata

Gli eventi figlio vengono inviati immediatamente agli oggetti quando vengono aggiunti o rimossi elementi figlio.

In entrambi i casi è possibile fare affidamento solo sul fatto che l'elemento figlio sia un QObject (oppure, se QObject::isWidgetType() restituisce true, un QWidget). Questo perché nel caso QEvent::ChildAdded l'elemento figlio non è ancora completamente costruito; nel caso QEvent::ChildRemoved potrebbe essere già stato distrutto.

Il gestore di questi eventi è ` QObject::childEvent()`.

Documentazione delle funzioni membro

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

Crea un oggetto evento figlio di una specifica type per child.

type Può essere QEvent::ChildAdded, QEvent::ChildRemoved o QEvent::ChildPolished.

Vedi anche child().

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

Crea un'istanza di ` QChildEvent`. Questa funzione è stata eliminata.

bool QChildEvent::added() const

Restituisce ` true ` se ` type()` restituisce ` QEvent::ChildAdded`; altrimenti restituisce `false`.

QObject *QChildEvent::child() const

Restituisce l'oggetto figlio che è stato aggiunto o rimosso.

bool QChildEvent::polished() const

Restituisce ` true ` se ` type()` è ` QEvent::ChildPolished`; altrimenti restituisce `false`.

bool QChildEvent::removed() const

Restituisce " true " se " type()" è " QEvent::ChildRemoved"; altrimenti restituisce false.

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

Assegna " other " a questa istanza di " QChildEvent ". Questa funzione viene eliminata.

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

Assegna “ other ” a questa istanza di “ 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.