diff options
| author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-06-18 12:23:47 +0200 |
|---|---|---|
| committer | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-08-04 15:58:11 +0200 |
| commit | 288b0b64322c312a70f3d1692f2e3b0be2503ea2 (patch) | |
| tree | c63c2f7ef9bc6a19b0e6dc89433c5b50a7bb5e92 /src/dialogs/qquickdialog.cpp | |
| parent | 1930d82d3aa2f552f5936612d3e937e4ead5e56f (diff) | |
QQuickMenu: center menu when mouse not present
On touch platforms, QCursor::pos() will return the last
touch synthesized to a mouse pos. Since this will only
happen when the user taps on a control that does not
handle the touch, the position you get can easily be
very old. And in many cases, a mouse pos has never been
synthesized at all, and the position you get is inf.
As a quick fix, this patch checks if the mouse position is
invalid, and center the menu.
For a long term fix we need to find a way to expose touch events in
QGuiApplication, and write logic that determines when to use
touch and when to use mouse to position the menu, and if using touch,
which touch point should be used.
Change-Id: Ic4d2dd78372efcd0c2362204492e76f44ff0a49a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/dialogs/qquickdialog.cpp')
0 files changed, 0 insertions, 0 deletions
