diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-03-19 23:08:20 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-20 14:12:51 +0100 |
commit | 5bcb87babf3fa416375ada549108855b74be6a7b (patch) | |
tree | 8d51a1b886361ca0f54fc1ae4c628d2b71d68cdb /src | |
parent | 3e3d06d70575b638d667d2bedae7010dbe605680 (diff) |
QApplication: fix scroll phase handling for wheel events
Set scroll phase correctly for propagated wheel events, and do not
let Qt::ScrollBegin/End steal focus when using Qt::WheelFocus policy.
Change-Id: Ia38b64059d96a228c3b83c9b455db6e30dfb9a46
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index cb6f4aeecd..6cc4e704fb 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3097,12 +3097,12 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QPoint relpos = wheel->pos(); bool eventAccepted = wheel->isAccepted(); - if (e->spontaneous()) + if (e->spontaneous() && wheel->phase() == Qt::ScrollUpdate) QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); while (w) { QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), - wheel->modifiers()); + wheel->modifiers(), wheel->phase()); we.spont = wheel->spontaneous(); res = d->notify_helper(w, w == receiver ? wheel : &we); eventAccepted = ((w == receiver) ? wheel : &we)->isAccepted(); |