Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.6
Description
Currently zooming in / out canvas is not working for Qt for Webassembly
Looking from Chrome Devtool, there is this wheel event event listener in the attached picture, if remove this event listener, then canvas zoom works ( I am using a notebook with touchpad supporting pinch gesture, in this case pinch gesture is interpreted as wheel event which can be confirmed by event monitor on Chrome Devtool )
The interpretation of the above is that, there is some gap between wasm and JavaScript ( or say browser default ) event handling on wheel event (and pinch gesture on mobile). The event listener is registered by wasm, if it intercept the event then the default handler will not work, however in wasm the wheel event does not automatically translate to canvas zoom in / out. Perhaps it is expecting application to implement the logic, and it looks like such logic is missing in Qt.
The equivalent of above operation from Chrome Devtool can also be achieved by modifying the generated <applicant name>.js file, by commenting out call back registration functions. For example, commenting out function calls to __registerWheelEventCallback can make zoom work on desktop browser, commenting out function calls to __registerTouchEventCallback can also make zoom (by pinch gesture) work on mobile browser.
For desktop browser the above can be a workaround as long as the application does not need to handle wheel event. But for mobile browser the above will also prevent the application from receiving any touch event so it is not an option.