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

Re: Mouse tracking in QtCanvasView subclass

Subject: Re: Mouse tracking in QtCanvasView subclass
From: Joel Uckelman
Date: Thu, 13 Apr 2006 23:11:16 +0200
Thus spake Yuriy Rusinov:
> Hello, All !
> 
> I have class
> class WsView : public QtCanvasView
> {
>     Q_OBJECT
>     public:
> .....
>     signals:
>         void mouseMove (QMouseEvent *event);
>         void mousePress (QMouseEvent *event);
> .....
>     public slots:
>        void mouseMoveEvent (QMouseEvent *event);
>        void mousePressEvent (QMouseEvent *event);
> ...
> };
> 
> In WsView constructor I make this->setMouseTracking (true) and 
> this->viewport()->setMouseTracking (true); But event mouseMoveEvent (e); 
> does not generate. Where is problem ?

You need to reimplement contentsMouseMoveEvent(), not mouseMoveEvent().
 
-- 
J.

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

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