diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-17 15:53:22 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-29 12:27:06 +0100 |
| commit | c0eb347312a91147cc465e21e8f17e8e4d534dd3 (patch) | |
| tree | d842e6cbab962ce96b12eba783c318174b9579c0 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
| parent | ed21a9299fff4340a43f744e6282f063e8cb09eb (diff) | |
QQmlConnections: Allow connections to C++-defined methods
With qmltc you can produce classes derived from QQmlConnections with
handler methods that should still receive the signals.
Introduce a new helper class QQmlConnectionSlotDispatcher that enables
connections to a C++ method inside a QQmlConnections, in the same way as
QQmlBoundSignal does for Javascript functions.
Change QQmlConnectionsPrivate::boundsignals to allow for C++ slots
using QQmlConnectionSlotDispatcher. This allows usage of Connections QML
elements when they are compiled to C++ via qmltc.
Pick-to: 6.6 6.5
Fixes: QTBUG-119084
Change-Id: I05d78a45a703630f43d37337268d0a3df341e7d3
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 107f21087a..e09c9e0da0 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1207,7 +1207,7 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase if (!v4) break; - QQmlMetaObject::ArgTypeStorage storage; + QQmlMetaObject::ArgTypeStorage<9> storage; QQmlMetaObject::methodParameterTypes(This->signal, &storage, nullptr); int argCount = storage.size(); @@ -1928,7 +1928,7 @@ static ReturnedValue CallPrecise(const QQmlObjectOrGadget &object, const QQmlPro if (data.hasArguments()) { - QQmlMetaObject::ArgTypeStorage storage; + QQmlMetaObject::ArgTypeStorage<9> storage; bool ok = false; if (data.isConstructor()) @@ -2009,7 +2009,7 @@ static const QQmlPropertyData *ResolveOverloaded( int sumMethodMatchScore = bestSumMatchScore; if (!attempt->isV4Function()) { - QQmlMetaObject::ArgTypeStorage storage; + QQmlMetaObject::ArgTypeStorage<9> storage; int methodArgumentCount = 0; if (attempt->hasArguments()) { if (attempt->isConstructor()) { |
