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>
bb10
J-P Nurmi 2014-03-19 23:08:20 +01:00 committed by The Qt Project
parent 3e3d06d705
commit 5bcb87babf
1 changed files with 2 additions and 2 deletions

View File

@ -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();