qtdeclarative/tests/manual/windowembedding/examples/transform.qml

42 lines
964 B
QML
Raw Normal View History

Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
import QtQuick
Rectangle {
id: rootItem
gradient: Gradient.TemptingAzure
width: 500; height: 500
Rectangle {
id: rectangle
width: 200; height: 200
color: "lightgray"
transformOrigin: Item.TopLeft
transform: [
Translate { id: translation; x: 50; y: 50 }
]
scale: 1.5
Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
WindowContainer {
Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
width: 200; height: 200
window: Window {
color: "lightgray"
Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
Image {
source: "https://placedog.net/500/500?random"
anchors.fill: parent
}
Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
MouseArea {
anchors.fill: parent
onClicked: {
rectangle.scale += 0.1
}
Add preliminary support for embedding QWindows into Qt Quick The new WindowContainer item allows embedding arbitrary windows into the Qt Quick scene, including foreign windows such as native map or web views. A new parent property is also added to Window, allowing these to be embedded inside other Items without the need for an explicit window container, along with a new z property, allowing modifications to the child Window's stacking order. Splitting the Quick document up into child windows allows interesting use-cases, such as setting a different surface format on the child window, for example for enabling HDR without affecting the rest of the UI. The embedded windows are managed as a child windows of the root QQuickWindow, with positioning, sizing, and stacking order reflecting the implicit or explicit window container item. Clipping is also supported, by setting a mask on the embedded window. The advantage of managing all embedded windows as as children of the root window is that we always have a QQuickWindow to handle the stacking order, we're not limited by the platform surface clip, and don't risk being interleaved behind native parts of the window we embed into that we don’t control. [ChangeLog[Quick] Preliminary support for embedding QWindows into the Qt Quick scene has been added, along with a parent property on Window, to allow setting a visual parent of the Window. Task-number: QTBUG-102835 Change-Id: I78b973e2685fb0ebbc850a110712f3e747bfe09a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-27 16:57:00 +00:00
}
}
}
}
}