diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-03-04 19:12:31 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 17:39:27 +0100 |
commit | 88bb2aa7030d2958056f4e6b588e796e1f4538b1 (patch) | |
tree | ca24fd0da6d2573d9eb147a3804a31d422fbd4d0 /src/controls/qquickmenu.cpp | |
parent | 50899263b50ec8a8bff9ed0fbbf69b6c1d8aa9f7 (diff) | |
download | qtquickcontrols-88bb2aa7030d2958056f4e6b588e796e1f4538b1.tar.gz |
Popup Window: Privately expose popup geometry
Change-Id: I28a8edd657f02cecbd0c31965bd4085429cf4537
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/controls/qquickmenu.cpp')
-rw-r--r-- | src/controls/qquickmenu.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp index 7aa52d56..bb4c79b6 100644 --- a/src/controls/qquickmenu.cpp +++ b/src/controls/qquickmenu.cpp @@ -398,6 +398,7 @@ void QQuickMenu::__popup(qreal x, qreal y, int atItemIndex) m_popupWindow->setItemAt(atItem ? atItem->visualItem() : 0); connect(m_popupWindow, SIGNAL(visibleChanged(bool)), this, SLOT(windowVisibleChanged(bool))); + connect(m_popupWindow, SIGNAL(geometryChanged()), this, SIGNAL(__popupGeometryChanged())); m_popupWindow->setPosition(x + m_xOffset, y + m_yOffset); m_popupWindow->show(); @@ -420,6 +421,14 @@ void QQuickMenu::setPopupVisible(bool v) } } +QRect QQuickMenu::popupGeometry() const +{ + if (!m_popupWindow || !m_popupVisible) + return QRect(); + + return m_popupWindow->geometry(); +} + void QQuickMenu::__closeMenu() { setPopupVisible(false); |