aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopupanchors_p_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup QQuickPopupAnchorsJ-P Nurmi2018-05-021-6/+4
| | | | | | | | Don't access QQuickPopupPositioner directly, but call QQuickPopup's reposition() method instead so that we can lazy-create the positioner. Change-Id: Ieb6a6adf187fba8b4829e32e7656a25c5e82cfc3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add anchors property to Popup to allow centering in parent/windowMitch Curtis2018-03-221-0/+77
Currently, users must manually position their Popup using x and y bindings: Popup { x: (parent.width - width) / 2 y: (parent.height - height) / 2 } This patch adds an anchors property so that you can do this instead: Popup { anchors.centerIn: parent } It's also possible to conveniently center within the window from anywhere within the scene (106e7b63 also documents an alternative way of doing this using Overlay): Window { id: window Pane { Popup { anchors.centerIn: window } } } QQuickAnchors were never used with Popup, because we cannot use the QQuickAnchors implementation as-is, as the visual QQuickItem parent is not the actual parent item of QQuickPopupItem. Currently just centerIn is supported, as that's the most common use case. [ChangeLog][Controls][Popup] Added anchors.centerIn to Popup to allow a covenient way of centering a popup. Task-number: QTBUG-60354 Change-Id: Ia030f812df9da646fea8f373ef6199a21205ffbd Reviewed-by: J-P Nurmi <jpnurmi@qt.io>