10 static const Platform qtDetectedPlatform = ([]() {
12 emscripten::val rawPlatform = emscripten::val::global(
"navigator")[
"platform"];
14 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"Mac")))
15 return Platform::MacOS;
16 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"iPhone"))
17 || rawPlatform.call<
bool>(
"includes", emscripten::val(
"iPad")))
19 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"Win32")))
20 return Platform::Windows;
21 if (rawPlatform.call<
bool>(
"includes", emscripten::val(
"Linux"))) {
22 emscripten::val uAgent = emscripten::val::global(
"navigator")[
"userAgent"];
23 if (uAgent.call<
bool>(
"includes", emscripten::val(
"Android")))
24 return Platform::Android;
25 return Platform::Linux;
27 return Platform::Generic;
29 return qtDetectedPlatform;