QChildWindowEvent Class

QChildWindowEvent 类包含子窗口更改的事件参数。更多

头文件: #include <QChildWindowEvent>
CMake.QChildWindowEvent 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

详细描述

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

在这两种情况下,您只能依赖于子窗口是QWindow ,而不是子窗口的任何子类。这是因为在QEvent::ChildWindowAdded 的情况下,子类尚未完全构建,而在QEvent::ChildWindowRemoved 的情况下,子类可能已被析构。

成员函数文档

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

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

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

另请参阅 child() 。

QWindow *QChildWindowEvent::child() const

返回添加或删除的子窗口。

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