This uses the "Cally" JS calendar component as the
native window, since the built in calendar input displays
the calendar as a popup and not on the input element
itself.
The native calendar element is created from JavaScript,
ownership is then passed to emscripten::val on the C++
side:
element -> EM_VAL -> emscripten::val
Alternatively, the calendar could also have been created
from C++ using code like
val calendar = val::global("document").call<val>("createElement", std::string("calendar-date"));
calendar["innerHTML"] = std::string("<calendar-month></calendar-month>");
We create a copy of the calendar val on the heap in order
to be able to pass a pointer to fromWinId() which does not
become stale when the function returns.
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: Ib68e82f01dc1c489b847b794aa09d6ccc9986157
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The example showcases window embedding on macOS, Windows, X11 (using
GTK), iOS (and visionOS), and Android, using both Qt Gui, Qt Widgets,
and Qt Quick.
Pick-to: 6.8 6.8.0
Change-Id: Iaa61eb3556ce2293371a3e127906378ac077c553
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>