views:

410

answers:

1

Hi

I am trying to create an HTML GUI for an application using Qt's WebKit... so far everything is going smooth with a minor problem, I don't want people to be able to drag and drop images from my GUI. I have disabled text selection using a small java script. But I'm not sure how to disable image dragging.... I have used onmousedown="return false" in the body tag but it disables mouse clicking and this would affect all of my input fields since the user will not be able to get the focus on input objects using the mouse..... Here's the method I used to disable the mouse gestures.

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

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

I am not sure if there is an actual option/attribute in qtwebkit itself to disable dragging as I haven't stumbled upon anything relative to this matter plus I don't wanna use the onmousedown="return false" code for each image individually as this would be a code massacre.

Edit: Plus some images will work as buttons and disabling mouse clicks will make them stop functioning.

+4  A: 

Try

body ondragstart="return false"
SleepyCod