このページでは

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

プロテクトされた関数

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

詳細な説明

子イベントは、子が追加または削除されると、直ちにオブジェクトに送信されます。

どちらの場合も、子オブジェクトが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()も参照してください 。

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

QChildEvent のインスタンスをMoveコンストラクタで生成します。この関数は削除されています。

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 を返します。

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

other をこのQChildEvent インスタンスに割り当てます。この関数は削除されます。

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

other をこの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.