javascript - Disable dragdrop in QtWebkit - Stack Overflow

I am trying to create an HTML GUI for an application using Qt's WebKit... so far everything is goi

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 badges
Add a ment  | 

1 Answer 1

Reset to default 10

Try

body ondragstart="return false"

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744190874a4562426.html

相关推荐

  • javascript - Disable dragdrop in QtWebkit - Stack Overflow

    I am trying to create an HTML GUI for an application using Qt's WebKit... so far everything is goi

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信