QQmlV4Function allows passing arbitrary parameters from C++ to a QML function. In most cases, we are however not interested in arbitrary parameters, but a fixed set of them. In those cases, using normal C++ overloads and letting the engine select the correct one is preferable:
- The engine is able to do expected conversions, if they become necessary
- Both the compiler and to a lesser extent qmllint/qmllsp cannot handle QQmlV4Function
The main remaining use case for using QQmlV4Function should be accepting an arbitrary number of JS object arguments. For that, we currently lack a good alternative.
|For Gerrit Dashboard: QTBUG-105139|
|423113,8||QQuickItem: make map(From|To)(Item|Global) type-safe in QML||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|424183,8||QQuickLoader: Remove QQmlV4Function usage||dev||qt/qtdeclarative||Status: MERGED||+2||0|