Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.0 RC
-
-
08b0e3e39 (dev), 0ae3697cf (6.8)
Description
QQuickItem::mapToItem() can crash if called during initialization of the Qml scene while the window is not mapped yet.
QPointF QQuickItem::mapToItem(const QQuickItem *item, const QPointF &point) const { QPointF p = mapToScene(point); if (item) { if (item->window() != window()) p = item->window()->mapFromGlobal(window()->mapToGlobal(p)); p = item->mapFromScene(p); } return p; }
There are two null check missing in
p = item->window()->mapFromGlobal(window()->mapToGlobal(p));
.
Btw, how could that line of code pass code review? It violently violates the SLR principle.
Attachments
Issue Links
- links to
For Gerrit Dashboard: QTBUG-129500 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
595278,8 | QQuickItem::map{To,From}Item: Account for not having a window yet | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
595336,2 | QQuickItem::map{To,From}Item: Account for not having a window yet | 6.8.0 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
595475,2 | QQuickItem::map{To,From}Item: Account for not having a window yet | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |