aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-07-28 11:21:25 +0200
committerMitch Curtis <mitch.curtis@qt.io>2021-07-28 11:21:25 +0200
commit16436239cd35ba7346b89a1f57d5b29dc786f4c6 (patch)
tree7e9011d0dfdda5ef9ccc302dae69ab3e5ba4b8cc /src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc
parent5a5b9c2344b961e984a2c860bb0c33022d641f32 (diff)
parent89d3486ad18d782a8141037a2bffb7992118cc78 (diff)
Merge qtquickcontrols2 into qtdeclarative
Diffstat (limited to 'src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc')
-rw-r--r--src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc b/src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc
new file mode 100644
index 0000000000..5562f6a039
--- /dev/null
+++ b/src/quickcontrols2/doc/src/includes/qquickoverlay-popup-parent.qdocinc
@@ -0,0 +1,20 @@
+The following example uses the attached \l {Overlay::overlay}{Overlay.overlay}
+property to position a popup in the center of the window, despite the position
+of the button that opens the popup:
+
+\code
+Button {
+ onClicked: popup.open()
+
+ Popup {
+ id: popup
+
+ parent: Overlay.overlay
+
+ x: Math.round((parent.width - width) / 2)
+ y: Math.round((parent.height - height) / 2)
+ width: 100
+ height: 100
+ }
+}
+\endcode