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.
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.
Share Improve this question asked Jan 11, 2010 at 7:07 Zaid AmirZaid Amir 4,7958 gold badges57 silver badges107 bronze badges1 Answer
Reset to default 10Try
body ondragstart="return false"
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744190874a4562426.html
评论列表(0条)