Showing the changes to libraries/script-engine/src/qtscript/ScriptObjectQtProxy.cpp (1 of 3 files). Show all
Unified · Split
| @@ -185,6 +185,8 @@ void ScriptObjectQtProxy::investigate() { · 184 unmodified lines | ||
| 185 | 185 | continue; |
| 186 | 186 | } |
| 187 | 187 | break; |
| 188 | + default: | |
| 189 | + ; | |
| 188 | 190 | } |
| 189 | 191 | |
| 190 | 192 | QScriptString name = _engine->toStringHandle(QString::fromLatin1(szName)); |
| @@ -207,6 +209,13 @@ void ScriptObjectQtProxy::investigate() { · 16 unmodified lines | ||
| 207 | 209 | } |
| 208 | 210 | } else { |
| 209 | 211 | int parameterCount = method.parameterCount(); |
| 212 | + if (name.toString() == "getRenderMethod"){ | |
| 213 | + qDebug() << name << " " << QMetaType(method.returnType()).name(); | |
| 214 | + if(method.returnType() == QMetaType::UnknownType) { | |
| 215 | + qDebug() << "Method with QMetaType::UnknownType"; | |
| 216 | + } | |
| 217 | + printf("getRenderMethod"); | |
| 218 | + } | |
| 210 | 219 | if (nameLookup == methodNames.end()) { |
| 211 | 220 | MethodDef& methodDef = _methods.insert(idx, MethodDef()).value(); |
| 212 | 221 | methodDef.name = name; |
| @@ -317,6 +326,13 @@ QScriptValue ScriptObjectQtProxy::property(const QScriptValue& object, const QSc · 104 unmodified lines | ||
| 317 | 326 | MethodDefMap::const_iterator lookup = _methods.find(methodId); |
| 318 | 327 | if (lookup == _methods.cend()) return QScriptValue(); |
| 319 | 328 | const MethodDef& methodDef = lookup.value(); |
| 329 | + for (auto iter = methodDef.methods.begin(); iter != methodDef.methods.end(); iter++ ) { | |
| 330 | + //qDebug() << (*iter).returnType(); | |
| 331 | + if((*iter).returnType() == QMetaType::UnknownType) { | |
| 332 | + qDebug() << "Method with QMetaType::UnknownType " << metaObject->className() << " " << (*iter).name(); | |
| 333 | + printf("Method with QMetaType::UnknownType"); | |
| 334 | + } | |
| 335 | + } | |
| 320 | 336 | return static_cast<QScriptEngine*>(_engine)->newObject( |
| 321 | 337 | new ScriptMethodQtProxy(_engine, qobject, object, methodDef.methods, methodDef.numMaxParms)); |
| 322 | 338 | } |
| @@ -589,19 +605,17 @@ int ScriptSignalQtProxy::qt_metacall(QMetaObject::Call call, int id, void** argu · 266 unmodified lines | ||
| 589 | 605 | QVariant argValue(methodArgTypeId, arguments[arg+1]); |
| 590 | 606 | args.append(_engine->castVariantToValue(argValue)); |
| 591 | 607 | } |
| 592 | − | |
| 608 | + | |
| 593 | 609 | QList<Connection> connections; |
| 594 | 610 | withReadLock([&]{ |
| 595 | − for (ConnectionList::iterator iter = _connections.begin(); iter != _connections.end(); ++iter) { | |
| 596 | − connections.push_back(*iter); | |
| 597 | − } | |
| 611 | + connections = _connections; | |
| 598 | 612 | }); |
| 599 | − | |
| 613 | + | |
| 600 | 614 | for (ConnectionList::iterator iter = connections.begin(); iter != connections.end(); ++iter) { |
| 601 | 615 | Connection& conn = *iter; |
| 602 | 616 | conn.callback.call(conn.thisValue, args); |
| 603 | 617 | } |
| 604 | − | |
| 618 | + | |
| 605 | 619 | return -1; |
| 606 | 620 | } |
| 607 | 621 | |
| @@ -713,7 +727,7 @@ void ScriptSignalQtProxy::disconnect(QScriptValue arg0, QScriptValue arg1) { · 105 unmodified lines | ||
| 713 | 727 | } |
| 714 | 728 | |
| 715 | 729 | // remove it from our internal list of connections |
| 716 | − withReadLock([&]{ | |
| 730 | + withWriteLock([&]{ | |
| 717 | 731 | _connections.erase(lookup); |
| 718 | 732 | }); |
| 719 | 733 | |