summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp12
2 files changed, 10 insertions, 4 deletions
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index fcd675aa76..aaddaa894f 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -1302,7 +1302,7 @@ void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
// were not preserved in the QGraphicsSceneWheelEvent unfortunately
QWheelEvent wheelEvent(pos, event->screenPos(), QPoint(), angleDelta,
event->buttons(), event->modifiers(), Qt::NoScrollPhase,
- false, Qt::MouseEventNotSynthesized,
+ false, Qt::MouseEventSynthesizedByQt,
QPointingDevice::primaryPointingDevice());
QPointer<QWidget> focusWidget = d->widget->focusWidget();
extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 059617eb83..0daa0cfcb6 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2949,9 +2949,15 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
// a widget has already grabbed the wheel for a sequence
if (QApplicationPrivate::wheel_widget) {
- Q_ASSERT(phase != Qt::NoScrollPhase);
- w = QApplicationPrivate::wheel_widget;
- relpos = w->mapFromGlobal(wheel->globalPosition().toPoint());
+ // Qt explicitly synthesizes a spontaneous event for the receiver, done
+ // by QGraphicsProxyWidget - so trust it
+ if (wheel->source() == Qt::MouseEventSynthesizedByQt) {
+ QApplicationPrivate::wheel_widget = w;
+ } else {
+ Q_ASSERT(phase != Qt::NoScrollPhase);
+ w = QApplicationPrivate::wheel_widget;
+ relpos = w->mapFromGlobal(wheel->globalPosition().toPoint());
+ }
}
/*
Start or finish a scrolling sequence by grabbing/releasing the wheel via