From 106e7b631a8b969c851a5124d3f524ecf0b50ebf Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 15 Feb 2018 10:42:54 +0100 Subject: Document how to position a popup in the center of the window This was already in Overlay's docs, but not Popup's, so this patch moves the example to a .qdocinc and includes it in both places, creating a new Popup Positioning section in the process. Change-Id: I8e8438919fd849a8466b3a28133d22bb45f7dc19 Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickoverlay.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/quicktemplates2/qquickoverlay.cpp') diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index 38f7949e..fe61dae2 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -60,26 +60,9 @@ QT_BEGIN_NAMESPACE \l {Popup::dim}{dimmed} popup is visible. The overlay is an ordinary Item that covers the entire window. It can be used - as a visual parent to position a popup in scene coordinates. The following - example uses the attached \c overlay property to position a popup to the center - of the window, despite the position of the button that opens the popup. + as a visual parent to position a popup in scene coordinates. - \code - Button { - onClicked: popup.open() - - Popup { - id: popup - - parent: Overlay.overlay - - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 100 - height: 100 - } - } - \endcode + \include qquickoverlay-popup-parent.qdocinc \sa ApplicationWindow */ -- cgit v1.2.3