PDA

View Full Version : Send a mouse right click into QGRaphicsScene



jano_alex_es
9th March 2010, 16:43
Hi,

how can I perform a mouse press button by code into a QGraphicsView/QGraphicsScene?

I tried to create a QMouseEvent and execute a myView::QGraphicsMouseEvent(event) but it doesn't seem to work.

any other idea?

thanks!

aamer4yu
9th March 2010, 17:09
Try sending event with QApplication::sendEvent

zgulser
11th March 2010, 14:47
I tried to create a QMouseEvent and execute a myView::QGraphicsMouseEvent(event) but it doesn't seem to work.

You need to set call QGraphicsView::mousePressEvent(event) at the end of yourView::mousePressEvent(event) method in order to catch it in the scene.