- Qt 6.9
- Qt GUI
- C++ Classes
- QChildWindowEvent
- Qt 6.9.2 Reference Documentation

# QChildWindowEvent Class

The QChildWindowEvent class contains event parameters for child window changes. More...

Header: | `#include <QChildWindowEvent>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Gui)` `target_link_libraries(mytarget PRIVATE Qt6::Gui)`
qmake: | `QT += gui`
Since: | Qt 6.7
Inherits: | QEvent

- List of all members, including inherited members
- QChildWindowEvent is part of Event Classes.

## Public Functions

| QChildWindowEvent(QEvent::Type type, QWindow *childWindow)
QWindow * | child() const

## Detailed Description

Child window events are sent to windows when children are added or removed.

In both cases you can only rely on the child being a QWindow — not any subclass thereof. This is because in the QEvent::ChildWindowAdded case the subclass is not yet fully constructed, and in the QEvent::ChildWindowRemoved case it might have already been destructed.

## Member Function Documentation

### `[explicit]` QChildWindowEvent::QChildWindowEvent(QEvent::Type type, QWindow *childWindow)

Constructs a child window event object of a particular type for the childWindow.

type can be QEvent::ChildWindowAdded or QEvent::ChildWindowRemoved.

See also child().

### QWindow *QChildWindowEvent::child() const

Returns the child window that was added or removed.