mirror of https://github.com/qt/qtdoc.git
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> |
||
---|---|---|
.. | ||
doc | ||
CMakeLists.txt | ||
Main.qml | ||
main.cpp |