Showing the changes to libraries/script-engine/src/MenuItemProperties.cpp (1 of 16 files). Show all
Unified · Split
| @@ -18,6 +18,12 @@ · 17 unmodified lines | |||
| 18 | #include "ScriptEngine.h" | 18 | #include "ScriptEngine.h" |
| 19 | #include "ScriptEngineCast.h" | 19 | #include "ScriptEngineCast.h" |
| 20 | #include "ScriptValue.h" | 20 | #include "ScriptValue.h" |
| 21 | #include "ScriptManager.h" | ||
| 22 | |||
| 23 | STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){ | ||
| 24 | auto scriptEngine = manager->engine().get(); | ||
| 25 | scriptRegisterMetaType<MenuItemProperties, menuItemPropertiesToScriptValue, menuItemPropertiesFromScriptValue>(scriptEngine, "MenuItemProperties"); | ||
| 26 | })); | ||
| 21 | 27 | ||
| 22 | MenuItemProperties::MenuItemProperties(const QString& menuName, const QString& menuItemName, | 28 | MenuItemProperties::MenuItemProperties(const QString& menuName, const QString& menuItemName, |
| 23 | const QString& shortcutKey, bool checkable, bool checked, bool separator) : | 29 | const QString& shortcutKey, bool checkable, bool checked, bool separator) : |
| @@ -44,10 +50,6 @@ MenuItemProperties::MenuItemProperties(const QString& menuName, const QString& m · 20 unmodified lines | |||
| 44 | { | 50 | { |
| 45 | } | 51 | } |
| 46 | 52 | ||
| 47 | void registerMenuItemProperties(ScriptEngine* engine) { | ||
| 48 | scriptRegisterMetaType<MenuItemProperties, menuItemPropertiesToScriptValue, menuItemPropertiesFromScriptValue>(engine, "MenuItemProperties"); | ||
| 49 | } | ||
| 50 | |||
| 51 | ScriptValue menuItemPropertiesToScriptValue(ScriptEngine* engine, const MenuItemProperties& properties) { | 53 | ScriptValue menuItemPropertiesToScriptValue(ScriptEngine* engine, const MenuItemProperties& properties) { |
| 52 | ScriptValue obj = engine->newObject(); | 54 | ScriptValue obj = engine->newObject(); |
| 53 | // not supported | 55 | // not supported |