最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Disable dragdrop in QtWebkit - Stack Overflow

programmeradmin6浏览0评论

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"
发布评论

评论列表(0)

  1. 暂无评论