How do I reconize a Mouse Click inside a canvas?

Eric Klumpp eric.klumpp at emailforever.com
Mon Jun 17 22:50:20 BST 2002


Hello,

I recently used the canvas !
To use the mousePressEvent, I do as it is rapidely explained in the Qt 
help for QCanvasView : I have done my own sub-class of QCanvasView that 
I named TView_Canvas, and I added the protected method declaration 
"virtual void contentsMousePressEvent(QMouseEvent* e)", and its 
definition as explained.

My project is a SDI, but emit a signal in this method should certainly 
resolve your problem !

Eric

PS : I use Qt 2.3.1, it is perhaps different on an other version


Janito Vaqueiro Ferreira Filho wrote:

>Hello,
>	I want to reconize a mousePressEvent in a QCanvasView from outside the 
>QCanvasView. How do I do that. My program is a MDI. Do I have to make a new 
>QCanvasView class a a new QCanvas class?
>
>
>MainWindow class
>		View class
>			CanvasView
>			mousePressEvent(QMouseEvent*)
>				// Here I must reconize when the Canvas was clicked
>		Doc class
>			Canvas
>
>-
>to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
>unsubscribe »your-email-address«
>
>



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list