WindowContainer QML Type

Allows embedding arbitrary QWindows into a Qt Quick scene. 更多...

import 语句: import QtQuick
Since: Qt 6.7
继承:

Item

状态: Preliminary

This type is under development and is subject to change.

特性

详细描述

The window will become a child of the item's window, with its position, size, z-order, etc. managed by the item.

Sibling items with a higher z-order than the window container will not automatically overlap the embedded window, as the window lives on top of the Qt Quick scene. To work around this, place the sibling items inside their own dedicated child window:

Item {
    id: someItem
    WindowContainer {
        window: foreignWindow
    }
    Window {
        parent: someItem
        Item {
            id: siblingItem
        }
    }
}
					

Similarly, child Items of the window container will not automatically overlap the embedded window. To work around this, place the child item inside a dedicated child window.

Item {
    id: someItem
    WindowContainer {
        id: windowContainer
        window: foreignWindow
        Window {
            parent: windowContainer
            Item {
                id: childItem
            }
        }
    }
}
					

If positioning and sizing of a Window via anchors is required, the Window can be wrapped in a window container:

Item {
    id: someItem
    WindowContainer {
        anchors.fill: parent
        window: Window {
            Item {
            }
        }
    }
}
					

注意: The window container does not interoperate with QQuickWidget , QQuickWindow::setRenderTarget (), QQuickRenderControl , or similar functionality.

另请参阅 QtQuick::Window::parent .

特性文档编制

window : QWindow

This property holds the window to embed.