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

Re: Mouse tracking in QtCanvasView subclass

Subject: Re: Mouse tracking in QtCanvasView subclass
From: Yuriy Rusinov
Date: Mon, 17 Apr 2006 12:03:02 +0400
Hello !

It won't work if you did it as in your example---contentsMouseMoveEvent()
(and mouseMoveEvent(), for that matter) should be virtual, and protected.


Ok, I corrected this class
class WsView : public QtCanvasView
{
...
   signals:
       void contentsMouseMove(QMouseEvent *e);
       void mouseMove(QMouseEvent * e);
       void mousePress(QMouseEvent * e);
       void mouseRelease(QMouseEvent * e);
       void mouseDoubleClick(QMouseEvent * e);
       void mouseContextMenu(QContextMenuEvent * e);
       void viewportResize(QResizeEvent * e);
...
   public slots:

       //void mouseMoveEvent( QMouseEvent* e );
       void mousePressEvent( QMouseEvent* e );
       void mouseReleaseEvent ( QMouseEvent * e);
       void mouseDoubleClickEvent ( QMouseEvent * e);
       void contextMenuEvent( QContextMenuEvent* );
       void viewportResizeEvent( QResizeEvent *e );

       void focusIn( );
       void focusOut( );
   protected:
       virtual void mouseMoveEvent(QMouseEvent *e);
       virtual void contentsMouseMoveEvent(QMouseEvent * e);
...
};
but nothing changed, for example signals contentsMouseMove
(QMouseEvent* e) or mouseMove (QMouseEvent* e) does not emitted and
debug messages in this events processors are not write, but when I press
mouse button, all events are happened.

Best regards,
Yuriy Rusinov.




--
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/





--
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>