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
42 CustomMarshal& customType = _customTypes.insert(type, CustomMarshal()).value();42 CustomMarshal& customType = _customTypes.insert(type, CustomMarshal()).value();
43 customType.demarshalFunc = demarshalFunc;43 customType.demarshalFunc = demarshalFunc;
44 customType.marshalFunc = marshalFunc;44 customType.marshalFunc = marshalFunc;
45 qDebug() << "registerCustomType: " << QMetaType(type).name() << " type: " << type << " map size: " << _customTypes.size();
45}46}
46 47
47Q_DECLARE_METATYPE(ScriptValue);48Q_DECLARE_METATYPE(ScriptValue);
@@ -209,6 +210,13 @@ bool ScriptEngineQtScript::castValueToVariant(const QScriptValue& val, QVariant& · 161 unmodified lines
209 }210 }
210 }211 }
211 }212 }
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 }*/
212 220
213 if (destTypeId == qMetaTypeId<ScriptValue>()) {221 if (destTypeId == qMetaTypeId<ScriptValue>()) {
214 dest = QVariant::fromValue(ScriptValue(new ScriptValueQtWrapper(this, val)));222 dest = QVariant::fromValue(ScriptValue(new ScriptValueQtWrapper(this, val)));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t