summaryrefslogtreecommitdiff
path: root/src/qtdesktop/qtmenupopupwindow_p.h
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-02-20 21:12:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-21 11:49:36 +0100
commit634157ebf8cacef695b8bef813c9040e272738a7 (patch)
tree4a3bb217da48c562421986182fbdefdb251766eb /src/qtdesktop/qtmenupopupwindow_p.h
parent4b6ea0aa1a120a7e7878db7337761ddc3d35333b (diff)
downloadqtquickcontrols-634157ebf8cacef695b8bef813c9040e272738a7.tar.gz
Menu: Fix popup positioning at item
When popping up a menu with the mouse cursor under a certain item, the visual item coordinates may be resolved too late. To solve this, we listen to the item's position and update the popup window's position accordingly, in a similar fashion as we did for its size. Change-Id: I1a853e5bc0cd2c3d6765bcc34a9f63f8598099a0 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/qtdesktop/qtmenupopupwindow_p.h')
-rw-r--r--src/qtdesktop/qtmenupopupwindow_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qtdesktop/qtmenupopupwindow_p.h b/src/qtdesktop/qtmenupopupwindow_p.h
index fb0f56ac..b1a9c051 100644
--- a/src/qtdesktop/qtmenupopupwindow_p.h
+++ b/src/qtdesktop/qtmenupopupwindow_p.h
@@ -54,11 +54,13 @@ class QtMenuPopupWindow : public QQuickWindow
public:
QtMenuPopupWindow(QWindow *parent = 0);
void setMenuContentItem(QQuickItem *contentItem);
+ void setItemAt(const QQuickItem *menuItem);
void setParentWindow(QQuickWindow *parentWindow);
public Q_SLOTS:
void dismissMenu();
void updateSize();
+ void updatePosition();
Q_SIGNALS:
void menuDismissed();
@@ -72,6 +74,8 @@ private:
void forwardEventToTransientParent(QMouseEvent *);
bool m_pressedInside;
+ const QQuickItem *m_itemAt;
+ QPointF m_oldItemPos;
};
QT_END_NAMESPACE