[Qt-interest] Filtering Mouse events in QT

Zaid Amir z.alamir at genie-soft.com
Thu Mar 11 13:41:41 CET 2010


Hi

I have tried using an event filter but a drag event from QWebView does not
seem to occur when I drag the mouse to select text or pages from a webpage.
Most of the other mouse events seems to propagate from webview as I've been
able to filter out MouseButtonPress, MouseButtonRelease and MouseMove with
no problem. However, DragEnter, DragLeave and DragMove are not generated or
not grabbed by my event filter.

Any suggestions.

-----Original Message-----
From: Jeroen De Wachter [mailto:jeroen.dewachter at barco.com] 
Sent: Wednesday, March 10, 2010 5:51 PM
To: Zaid Amir
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Filtering Mouse events in QT

Hi Zaid,

I think a good place to start looking is the Mouse Tracking in QWidget 
(which will always trigger mouseMoveEvents on your widget, no matter if 
a mouse button was pressed on it or not) and the Drag&Drop functionality 
embedded in Qt: http://qt.nokia.com/doc/4.6/dnd.html

I don't think filtering the events is the best approach here, but other 
may prove me wrong.

Kind regards,

Jroen

Zaid Amir wrote:
> Hi
>
> I am trying to filter mouse events and keyboard gestures in QT. Basically
I
> have a webkit qwidget and I'm trying to disable text selection. I need to
do
> something like when a user tries dragging the mouse over some text or
> dragging an image.
>
> I am not sure how I can start doing this in QT since its not MFC based and
I
> don't have the faintest idea on how to get windows messages in QT.
>
> Any suggestions would be appreciated.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>   







More information about the Qt-interest-old mailing list