aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/doc/src/includes/qquickoverlay-popup-parent.qdocinc
blob: 7ad8a0038cbb0e29774a4cb17e7f65be94c3b85b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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: (parent.width - width) / 2
        y: (parent.height - height) / 2
        width: 100
        height: 100
    }
}
\endcode