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>
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;
QVERIFY(object != 0);
QCOMPARE(object->string(), QString());
emit object->unnamedArgumentSignal(19, 10.25, "Hello world!");
- QEXPECT_FAIL("", "QTBUG-24481", Continue);
QCOMPARE(object->string(), QString("pass 19 Hello world!"));
delete object;
}