diff options
author | Glenn Watson <glenn.watson@nokia.com> | 2012-07-25 09:48:42 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-25 06:13:14 +0200 |
commit | 14985d7b4347ed422358f963ae184f4dcb22f66f (patch) | |
tree | 0c65afdbed0cda40f69fc2b4cdfaf3436d7d7639 /src/qml/qml/qqmlboundsignal.cpp | |
parent | 3e5d9532391549cc115f4cc6a824401acd2e8600 (diff) |
Ensure params listed after unnamed params are available in QML.
If a parameter in a bound signal had no name, it was excluded from
the metaobject created by the bound signal expression. Change this
so that unnamed parameters are still added (with an anonymous
name). This means that subsequent parameters can be accessed from QML.
Task-number: QTBUG-24481
Change-Id: Ia3403fb3bdc3da0c7e58baf7e891b67ed413bebd
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlboundsignal.cpp')
-rw-r--r-- | src/qml/qml/qqmlboundsignal.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index 3713de9270..6c4465eb96 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -379,13 +379,15 @@ QQmlBoundSignalParameters::QQmlBoundSignalParameters(const QMetaMethod &method, types = new int[paramTypes.count()]; for (int ii = 0; ii < paramTypes.count(); ++ii) { const QByteArray &type = paramTypes.at(ii); - const QByteArray &name = paramNames.at(ii); - - if (name.isEmpty() || type.isEmpty()) { + if (type.isEmpty()) { types[ii] = 0; continue; } + QByteArray name = paramNames.at(ii); + if (name.isEmpty()) + name = "__qt_anonymous_param_" + QByteArray::number(ii); + int t = QMetaType::type(type.constData()); if (QQmlMetaType::isQObject(t)) { types[ii] = QMetaType::QObjectStar; |