Disable drag and drop in QtWebkit

I am trying to create an HTML GUI for an application using Qt WebKit ... while everything is going smoothly with a little problem, I do not want people to be able to drag and drop images from my GUI. I turned off text highlighting using a small java script. But I'm not sure how to turn off image dragging .... I used onmousedown = "return false" in the body tag, but it disables the mouse click and this will affect all my input fields, as the user will not be able to focus on input objects with using the mouse ..... Here is the method that I used to disable mouse gestures.

<html>
<head>
 ....
</head>

<body onmousedown="return false";>
....
</body>
</html>

I am not sure if there is an actual parameter / attribute in qtwebkit itself to disable drag and drop, since I have not stumbled upon anything regarding this question, and I do not want to use the onmousedown = "return false" code for each image individually, since this would be a massacre of code.

Edit: plus some images will work like buttons, and disabling mouse clicks will cause them to stop functioning.

+2
source share
1 answer

Try

body ondragstart="return false"
+8
source

All Articles