summaryrefslogtreecommitdiff
path: root/src/controls/qquickmenu_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-26 10:56:26 +0200
committerJ-P Nurmi <jpnurmi@digia.com>2014-09-30 15:27:06 +0200
commite1ba563285270fd20e0aa8b9692b1bf1686b0128 (patch)
tree642863bfafe1287b45a10a14d3839a8951a16a41 /src/controls/qquickmenu_p.h
parent00665083ce5ccccab00b852164f03fe1efa9c504 (diff)
downloadqtquickcontrols-e1ba563285270fd20e0aa8b9692b1bf1686b0128.tar.gz
qquickmenu: add support for providing a target rect to __popup()
Using a target rect as menu location instead of a position has been supported in QPlatformMenu for a while. The reason for specifying a rect instead of a position is that then the OS can decide if the popup should be placed above or below the target rect so that it fits inside the screen. A typical example is when showing an edit menu around a text selection. If the selection (target rectangle) is far up on the screen, the popup (with arrow) will be placed below the selection instead of above, which is the normal. Change-Id: Ie6cd6a92f1d9ef480c1e455960021c7f18f86569 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/qquickmenu_p.h')
-rw-r--r--src/controls/qquickmenu_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/controls/qquickmenu_p.h b/src/controls/qquickmenu_p.h
index 943c45bf..f21f2ce0 100644
--- a/src/controls/qquickmenu_p.h
+++ b/src/controls/qquickmenu_p.h
@@ -83,7 +83,7 @@ public:
Q_INVOKABLE void removeItem(QQuickMenuBase *);
Q_INVOKABLE void clear();
- Q_INVOKABLE void __popup(qreal x, qreal y, int atActionIndex = -1, MenuType menuType = DefaultMenu);
+ Q_INVOKABLE void __popup(const QRectF &targetRect, int atItemIndex = -1, MenuType menuType = DefaultMenu);
public Q_SLOTS:
void __closeMenu();