Hello,

I have an interesting problem I am trying to solve. I have a derived class of QGraphicsScene that draws a line in a rubber band fashion while the left mous button is depressed. What this means is that while I have the left button down it will show the line and I can draw it's position and length however I wish until I release the mouse button. At that time it will draw the object where it was when I left the button up.

What I want to do WHILE I am in rubberband mode, is let appear a cartesian plane axis whose origin is at the point I clicked the left mouse button to begin with. The cartesian plane axis' will continue to appear until I let the mouse button up. In addition, I wish to draw an arc between the x-axis and the line and display it's angle.

Please see attached picture for a view of what I want to see if I have the mouse button clicked and held down.

The problem I am having is that the cartesian axis seem to appear randomly and do not persist while I have the button clicked. I am defining it in the QGraphicsScene::drawbackground() overloaded function instead of the void QGraphicsScene::mouseMoveEvent(QGraphicsSceneMouse Event *mouseEvent) because of the access to the QPainter object.

Is there a better place to do this?

Cheers!
-Caolan

20160701_112930[1].jpg