History

Type registeration fixes for scripting engine

ksuprynowicz committed 4 years ago

Commit 0a3ec921 parent 50a6a6334 files · +266 −67Browse files

Showing the changes to libraries/script-engine/src/qtscript/ScriptEngineQtScript_cast.cpp (1 of 34 files). Show all

Unified · Split

libraries/script-engine/src/qtscript/ScriptEngineQtScript_cast.cpp+8−0
@@ -42,6 +42,7 @@ void ScriptEngineQtScript::registerCustomType(int type, · 41 unmodified lines
4242 CustomMarshal& customType = _customTypes.insert(type, CustomMarshal()).value();
4343 customType.demarshalFunc = demarshalFunc;
4444 customType.marshalFunc = marshalFunc;
45+ qDebug() << "registerCustomType: " << QMetaType(type).name() << " type: " << type << " map size: " << _customTypes.size();
4546 }
4647
4748 Q_DECLARE_METATYPE(ScriptValue);
@@ -209,6 +210,13 @@ bool ScriptEngineQtScript::castValueToVariant(const QScriptValue& val, QVariant& · 161 unmodified lines
209210 }
210211 }
211212 }
213+/* if (QMetaType(destTypeId).name() == "MenuItemProperties") {
214+ qDebug() << "castValueToVariant MenuItemProperties " << destTypeId << "map size: " << _customTypes.size();
215+ for (auto iter = _customTypes.keyBegin(); iter != _customTypes.keyEnd(); iter++){
216+ qDebug() << (*iter);
217+ }
218+ printf("castValueToVariant MenuItemProperties");
219+ }*/
212220
213221 if (destTypeId == qMetaTypeId<ScriptValue>()) {
214222 dest = QVariant::fromValue(ScriptValue(new ScriptValueQtWrapper(this, val)));