force Qt registration of PerformanceManager::PerformancePreset, as it's used as a return datatype in a script-callable function (and doesn't get auto-registered)

This commit is contained in:
Heather Anderson 2022-03-20 22:08:25 -07:00 committed by ksuprynowicz
parent 0bce0668f7
commit 4d6889a677

View file

@ -19,7 +19,11 @@
PerformanceManager::PerformanceManager()
{
setPerformancePreset((PerformancePreset) _performancePresetSetting.get());
static std::once_flag registry_flag;
std::call_once(registry_flag, [] {
qRegisterMetaType<PerformanceManager::PerformancePreset>("PerformanceManager::PerformancePreset");
});
setPerformancePreset((PerformancePreset)_performancePresetSetting.get());
}
void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTier) {