qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] How can I get the current cursor's position in dragMov

Subject: Re: [Qt-interest] How can I get the current cursor's position in dragMoveEvent ?
From: Benjamin Lau
Date: Sun, 2 Aug 2009 23:46:46 +0800
On Sun, Aug 2, 2009 at 5:26 PM, Kermit Mei<kermit.mei@xxxxxxxxx> wrote:
> Hello, I want to drag something, and I need to get the cursor's position
> in the dragMoveEvent(event). I can't use event->pos(), because is
> returns the position where the drag was make. But what I want is the
> current moved position, how can I get it?
>
> Thanks.
> Kermit Mei
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest@xxxxxxxxxxxxx
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>

dragMoveEvent is only called once when the drag starts. If you want
the position of the mouse as the mouse is moving, use the
mouseMoveEvent event handler.

For more information, see here:
http://doc.qtsoftware.com/4.5/qwidget.html#mouseMoveEvent

Hope this is what you're looking for!
Benjamin
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>