How can I disable the pinch-zoom action in Qt WebEngine 6.5.3
Unsolved
QtWebEngine
-
Hello,
I am using QtWebEngine to display a webpage I built in my Qt application, and I have implemented the following code to prevent the default wheel event behavior in the HTML file:
window.addEventListener('wheel', function(event) { if (event.ctrlKey) { event.preventDefault() } });
This solution effectively disables the pinch-to-zoom feature in desktop browsers like Google Chrome. However, when the page is loaded in Qt WebEngine, specifically on macOS, the pinch-to-zoom feature remains active. During the zoom process, no wheel, touch, gesture, or pointer events seem to be triggered on the window object.
Could you please provide some guidance on how to properly disable pinch-zoom functionality in Qt WebEngine on macOS?
Thank you.
-
For us it works with:
// Disable pinch zoom in web browser qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-pinch");