mirror of https://github.com/qt/qtbase.git
QWidget::mapTo/FromGlobal(): Fix transformation for QGraphicsView with offsets
Amends 474af0a61d
.
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>
This commit is contained in:
parent
25e16e20cc
commit
733459637e
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue