本页内容

QChildWindowEvent Class

QChildWindowEvent 类包含用于处理子窗口变化的事件参数。更多内容...

头文件: #include <QChildWindowEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
自: Qt 6.7
继承自: QEvent

公共函数

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

受保护函数

QChildWindowEvent(QChildWindowEvent &&)
QChildWindowEvent &operator=(QChildWindowEvent &&)
QChildWindowEvent &operator=(const QChildWindowEvent &other)

详细说明

当子窗口被添加或删除时,子窗口事件会被发送至窗口。

在这两种情况下,您只能假设子窗口是QWindow ,而不能假设它是该类的任何子类。这是因为在QEvent::ChildWindowAdded 的情况下,子类尚未完全构建;而在QEvent::ChildWindowRemoved 的情况下,它可能已经被销毁了。

成员函数文档

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

为childWindow 构建一个特定type 的子窗口事件对象。

type 可以是QEvent::ChildWindowAdded 或QEvent::ChildWindowRemoved 。

另请参阅 child()。

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

通过“move”操作构造一个QChildWindowEvent 的实例。该函数已被删除。

QWindow *QChildWindowEvent::child() const

返回已添加或已移除的子窗口。

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

将other 按移动赋值方式赋值给此QChildWindowEvent 实例。此函数已被删除。

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

将other 复制并赋值给此QChildWindowEvent 实例。

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