diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-10-30 16:24:18 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-11-01 17:07:07 +0100 |
| commit | 733459637e10edca006b0ad9b68299496e1b4ebd (patch) | |
| tree | 386079bea768554314c0ec661885969bce21fe8a /src/widgets/kernel/qwidget.cpp | |
| parent | 25e16e20cc434f484380dfa59c1b8a3d6f772920 (diff) | |
QWidget::mapTo/FromGlobal(): Fix transformation for QGraphicsView with offsets
Amends 474af0a61d6154006966a775d186687aa8881708.
The code had an error showing when the QGraphicsView was not at 0,0
in the window.
Pick-to: 6.8
Task-number: QTBUG-128913
Task-number: QTBUG-52507
Change-Id: Ic228cc7e71ef54dd23c946b9d90f9c45aac793d9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
| -rw-r--r-- | src/widgets/kernel/qwidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 11b76011590..9b2348cad96 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -12695,8 +12695,8 @@ static MapToGlobalTransformResult mapToGlobalTransform(const QWidget *w) break; } - const QPoint topLeft = w->geometry().topLeft(); - result.transform.translate(topLeft.x(), topLeft.y()); + const auto &geometry = w->geometry(); + result.transform *= QTransform::fromTranslate(geometry.x(), geometry.y()); if (w->isWindow()) break; } |
