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

Re: mouse tracking

Subject: Re: mouse tracking
From: Craig Ringer
Date: Sat, 12 Feb 2005 14:38:48 +0800
On Fri, 2005-02-11 at 11:00 -0800, Hendrik Greving wrote:

> allright, sounds good, that's exactly what i like to have. please let me 
> ask more detail. assuming i set a new bitmap using 
> qt/setcursor(qcursor). where's the difference to my current approach?

By the sounds of things nothing, but that's not what I'm talking about.
I'm suggesting that you _hide_ the cursor. See 'blankCursor' in the
QCursor docs. Then you'd need to track the cursor position in your app
using, eg, QWidget::mouseMoveEvent, and draw the cursor yourself within
the area you seek to limit it to. QPainter etc are probably worth
looking into here. This lets you make your own decisions about how the
cursor is rendered and where - for example, if it briefly skips outside
your app window, you can render it as still on the edge of the window
instead.

I haven't done this in Qt myself, so I can't offer you any more detailed
ideas than that without delving through the docs for info - something I
figure you can manage yourself ;-)

As I said before, I don't know if this is the right approach, but it's
probably worth a try.

--
Craig Ringer

--
List archive and information: http://lists.trolltech.com/qt-interest/

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