Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96664

wheel event or pinch gesture does not zoom canvas

    XMLWordPrintable

Details

    • WebAssembly

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lpotter Lorn Potter
            yifei Yi Fei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes