wasm: add iOS to platform detection

Add iPad and move iPhone platform to iOS

Pick-to: 6.6 6.5
Fixes: QTBUG-114446
Change-Id: I3f601fbe5f3899c0658ee65acf72bbf37d51bf73
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This commit is contained in:
Lorn Potter 2023-06-12 16:49:50 +10:00
parent 3a553507a1
commit 65f09d4e10
3 changed files with 6 additions and 5 deletions

View File

@ -66,7 +66,7 @@ QWasmInputContext::QWasmInputContext()
} }
if (platform() == Platform::MacOS || platform() == Platform::iPhone) { if (platform() == Platform::MacOS || platform() == Platform::iOS) {
auto callback = [=](emscripten::val) { auto callback = [=](emscripten::val) {
m_inputElement["parentElement"].call<void>("removeChild", m_inputElement); m_inputElement["parentElement"].call<void>("removeChild", m_inputElement);
inputPanelIsOpen = false; inputPanelIsOpen = false;
@ -118,7 +118,7 @@ void QWasmInputContext::showInputPanel()
// screen element. // screen element.
if (platform() == Platform::MacOS // keep for compatibility if (platform() == Platform::MacOS // keep for compatibility
|| platform() == Platform::iPhone || platform() == Platform::iOS
|| platform() == Platform::Windows) { || platform() == Platform::Windows) {
emscripten::val inputWrapper = inputHandlerElementForFocusedWindow(); emscripten::val inputWrapper = inputHandlerElementForFocusedWindow();
if (inputWrapper.isUndefined()) if (inputWrapper.isUndefined())

View File

@ -13,8 +13,9 @@ Platform platform()
if (rawPlatform.call<bool>("includes", emscripten::val("Mac"))) if (rawPlatform.call<bool>("includes", emscripten::val("Mac")))
return Platform::MacOS; return Platform::MacOS;
if (rawPlatform.call<bool>("includes", emscripten::val("iPhone"))) if (rawPlatform.call<bool>("includes", emscripten::val("iPhone"))
return Platform::iPhone; || rawPlatform.call<bool>("includes", emscripten::val("iPad")))
return Platform::iOS;
if (rawPlatform.call<bool>("includes", emscripten::val("Win32"))) if (rawPlatform.call<bool>("includes", emscripten::val("Win32")))
return Platform::Windows; return Platform::Windows;
if (rawPlatform.call<bool>("includes", emscripten::val("Linux"))) { if (rawPlatform.call<bool>("includes", emscripten::val("Linux"))) {

View File

@ -19,7 +19,7 @@ enum class Platform {
Windows, Windows,
Linux, Linux,
Android, Android,
iPhone, iOS
}; };
Platform platform(); Platform platform();