diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-08-11 14:21:53 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-16 21:27:11 +0000 |
commit | 2366be3c2c1e0277f5dba178729fa38a2d1d8dbe (patch) | |
tree | 696003527056c43029034fcf855fe9e801ba9d68 /tests | |
parent | e14bcfa7b43da159c894d22705a91b5e6f173164 (diff) |
QGraphicsProxyWidget: fix propagation of high-precision events
In order to fix QTBUG-95552 properly we have to add APIs to
QGraphicsSceneWheelEvent that informs QGraphicsProxyWidget about
whether the event is a high-precision event where Qt grabs the
wheel.
If it is, then the wheel grabber will be the QGraphicsView's viewport,
and any wheel event sent to any widget will be grabbed by it. This
results in infinite recoursion, partly fixed in change
I78400ceae8da7a4e22a988c06ed58f99f1a979f4.
The proper fix is to re-grab the wheel by the embedded widget
if it (or any of its children) accepts the ScrollBegin event (and if
not, return the grab to the QGraphicsView).
This fixes the scenarios that failed in the test case, so now scrolling
through nested widgets and scrolling in nested widgets works as the
user would expect.
Fixes: QTBUG-95552
Change-Id: I3e1f31cbff999c70f8c63c034f77cd2ae567d7e3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 06235d36ae9d00366215e748d80ff0faed3c2124)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index bbcef8849e..500b8e3c4b 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -2351,12 +2351,9 @@ void tst_QGraphicsView::wheelEventPropagation() QCOMPARE(scrollSpy.count(), ++scrollCount); for (int i = 0; i < 5; ++i) { wheelUp(Qt::ScrollUpdate); - if (i >= 1) - QEXPECT_FAIL("", "Fixed for Qt 6.2 - QTBUG-65552", Continue); QCOMPARE(scrollSpy.count(), ++scrollCount); } wheelUp(Qt::ScrollEnd); - QEXPECT_FAIL("", "Fixed for Qt 6.2 - QTBUG-65552", Continue); QCOMPARE(scrollSpy.count(), ++scrollCount); // reset @@ -2373,11 +2370,9 @@ void tst_QGraphicsView::wheelEventPropagation() QCOMPARE(scrollSpy.count(), ++scrollCount); for (int i = 0; i < 5; ++i) { wheelUp(Qt::ScrollUpdate); - QEXPECT_FAIL("", "Fixed for Qt 6.2 - QTBUG-65552", Continue); QCOMPARE(scrollSpy.count(), ++scrollCount); } wheelUp(Qt::ScrollEnd); - QEXPECT_FAIL("", "Fixed for Qt 6.2 - QTBUG-65552", Continue); QCOMPARE(scrollSpy.count(), ++scrollCount); // starting a scroll on a widget that does accept wheel events |