When cloning QWheelEvent, also propagate the event's timestamp
Task-number: QTBUG-63681 Change-Id: I686ea831287ac9023a3364768b6345c1e8806439 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
2b540ac741
commit
529cb7217c
@ -3272,6 +3272,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
||||
|
||||
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
|
||||
wheel->modifiers(), phase, wheel->source(), wheel->inverted());
|
||||
we.setTimestamp(wheel->timestamp());
|
||||
bool eventAccepted;
|
||||
do {
|
||||
we.spont = spontaneous && w == receiver;
|
||||
@ -3308,6 +3309,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
||||
const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPos());
|
||||
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
|
||||
wheel->modifiers(), wheel->phase(), wheel->source());
|
||||
we.setTimestamp(wheel->timestamp());
|
||||
we.spont = true;
|
||||
we.ignore();
|
||||
d->notify_helper(QApplicationPrivate::wheel_widget, &we);
|
||||
|
@ -840,6 +840,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
|
||||
QPoint mapped = widget->mapFrom(rootWidget, pos);
|
||||
|
||||
QWheelEvent translated(mapped, event->globalPos(), event->pixelDelta(), event->angleDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers(), event->phase(), event->source(), event->inverted());
|
||||
translated.setTimestamp(event->timestamp());
|
||||
QGuiApplication::forwardEvent(widget, &translated, event);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user