QChildEvent Class

QChildEvent クラスは、子オブジェクト・イベントのイベント・パラメータを含んでいます。詳細...

ヘッダ #include <QChildEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
継承: QEvent

パブリック関数

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

詳細説明

子イベントは、子が追加されたり削除されたりしたときに、オブジェクトに即座に送られます。

どちらの場合も、子がQObject (または、QObject::isWidgetType() がtrue を返す場合は、QWidget )であることだけを頼りにすることができます。これは、QEvent::ChildAdded の場合、子はまだ完全に構築されていないからです。QEvent::ChildRemoved の場合は、すでに破棄されているかもしれません。

これらのイベントのハンドラはQObject::childEvent() である。

メンバ関数ドキュメント

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

child に対して、特定のtype の子イベントオブジェクトを構築する。

type には、 、 、または を指定できます。QEvent::ChildAdded QEvent::ChildRemoved QEvent::ChildPolished

child()も参照

bool QChildEvent::added() const

type() がQEvent::ChildAdded であればtrue を返し、そうでなければ false を返す。

QObject *QChildEvent::child() const

追加または削除された子オブジェクトを返します。

bool QChildEvent::polished() const

type() がQEvent::ChildPolished であればtrue を返し、そうでなければ false を返す。

bool QChildEvent::removed() const

type() がQEvent::ChildRemoved であればtrue を返し、そうでなければ false を返す。

© 2025 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.