[Qt-interest] disabling drag and drop from a QWebView

Girish Ramakrishnan girish at forwardbias.in
Wed Sep 9 11:21:24 CEST 2009


Boudewijn Rempt wrote:
> Hi,
> 
> I've got a QWebView with a page that contains an image. The user can drag
> that image from the page to anywhere, including drop zones in my application.
> I would like to disable dragging -- is that possible?
> 

The initial mouse press position of a drag is recorded in
mousePressEvent and the actual drag is started in mouseMoveEvent. So, if
you override both in your custom QWebView, and check if the mouse press
happened on an image (using hitTestContent) and then ignore the
impending mouse move events, you should be able to disable it.

Girish



More information about the Qt-interest-old mailing list