Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.2.0
-
None
-
b9ff90423879c9b27d049b47b1b19a6695878ccd
Description
The number of arguments in QML function Item::mapToItem is not checked properly. The documentation defines a 3 parameter and a 5 parameter signature.
When you use 2 or 4 parameters, the behaviour is undefined but no error is shown. This is caused by a vague case distinction in QQuickItem::mapToItem(QQmlV4Function *args)
qtdeclarative/src/quick/items/qquickitem.cpp
// Line 3983 if (args->length() > 3) { // case A } else { // case B }
This is especially problematically because the QML function can be confused with the C++ function QQuickItem::mapToItem(const QQuickItem *, const QPointF &).
See also problem description on Stack Overflow.
The same goes for mapFromItem