History

Fixes to problems with meta-types

ksuprynowicz committed 4 years ago

Commit 50a6a631 parent 33c86078 files · +43 −15Browse files

Showing the changes to interface/src/scripting/PlatformInfoScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

interface/src/scripting/PlatformInfoScriptingInterface.cpp+8−0
@@ -1,6 +1,7 @@
1//1//
2// Created by Nissim Hadar on 2018/12/282// Created by Nissim Hadar on 2018/12/28
3// Copyright 2013-2016 High Fidelity, Inc.3// Copyright 2013-2016 High Fidelity, Inc.
4// Copyright 2022 Overte e.V.
4//5//
5// Distributed under the Apache License, Version 2.0.6// Distributed under the Apache License, Version 2.0.
6// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html7// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -12,6 +13,7 @@ · 5 unmodified lines
12 13
13#include <platform/Platform.h>14#include <platform/Platform.h>
14#include <platform/Profiler.h>15#include <platform/Profiler.h>
16#include <ScriptEngineCast.h>
15 17
16#ifdef Q_OS_WIN18#ifdef Q_OS_WIN
17#include <Windows.h>19#include <Windows.h>
@@ -19,6 +21,12 @@ · 1 unmodified line
19#include <sstream>21#include <sstream>
20#endif22#endif
21 23
24STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){
25 auto scriptEngine = manager->engine().get();
26
27 scriptRegisterMetaType(scriptEngine, scriptValueFromEnumClass<PlatformInfoScriptingInterface::PlatformTier>, scriptValueToEnumClass<PlatformInfoScriptingInterface::PlatformTier>, "PlatformTier");
28});
29
22PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {30PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {
23 static PlatformInfoScriptingInterface sharedInstance;31 static PlatformInfoScriptingInterface sharedInstance;
24 return &sharedInstance;32 return &sharedInstance;