Showing the changes to interface/src/scripting/PerformanceScriptingInterface.cpp (1 of 8 files). Show all
Unified · Split
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | // |
| 2 | 2 | // Created by Bradley Austin Davis on 2019/05/14 |
| 3 | 3 | // Copyright 2013-2019 High Fidelity, Inc. |
| 4 | +// Copyright 2022 Overte e.V. | |
| 4 | 5 | // |
| 5 | 6 | // Distributed under the Apache License, Version 2.0. |
| 6 | 7 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| @@ -9,15 +10,24 @@ · 2 unmodified lines | ||
| 9 | 10 | |
| 10 | 11 | #include "PerformanceScriptingInterface.h" |
| 11 | 12 | |
| 13 | +#include <ScriptEngineCast.h> | |
| 14 | + | |
| 12 | 15 | #include "../Application.h" |
| 13 | 16 | |
| 17 | +STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){ | |
| 18 | + auto scriptEngine = manager->engine().get(); | |
| 19 | + | |
| 20 | + scriptRegisterMetaType(scriptEngine, scriptValueFromEnumClass<PerformanceScriptingInterface::PerformancePreset>, scriptValueToEnumClass<PerformanceScriptingInterface::PerformancePreset>, "PerformancePreset"); | |
| 21 | + scriptRegisterMetaType(scriptEngine, scriptValueFromEnumClass<PerformanceScriptingInterface::RefreshRateProfile>, scriptValueToEnumClass<PerformanceScriptingInterface::RefreshRateProfile>, "RefreshRateProfile"); | |
| 22 | +}); | |
| 23 | + | |
| 14 | 24 | std::once_flag PerformanceScriptingInterface::registry_flag; |
| 15 | 25 | |
| 16 | 26 | PerformanceScriptingInterface::PerformanceScriptingInterface() { |
| 17 | 27 | std::call_once(registry_flag, [] { |
| 18 | 28 | qmlRegisterType<PerformanceScriptingInterface>("PerformanceEnums", 1, 0, "PerformanceEnums"); |
| 19 | − qRegisterMetaType<PerformanceScriptingInterface::PerformancePreset>("PerformanceScriptingInterface::PerformancePreset"); | |
| 20 | − qRegisterMetaType<PerformanceScriptingInterface::RefreshRateProfile>("PerformanceScriptingInterface::RefreshRateProfile"); | |
| 29 | + //qRegisterMetaType<PerformanceScriptingInterface::PerformancePreset>("PerformanceScriptingInterface::PerformancePreset"); | |
| 30 | + //qRegisterMetaType<PerformanceScriptingInterface::RefreshRateProfile>("PerformanceScriptingInterface::RefreshRateProfile"); | |
| 21 | 31 | }); |
| 22 | 32 | } |
| 23 | 33 | |