PDA

View Full Version : Drawing with the mouse



Manobala
14th July 2015, 05:33
hai to all i had drawn a line on image using qpainter and i need to move that line on the image surface can any one give code for it thanking you

d_stranz
14th July 2015, 16:06
Why don't you study the Qt tutorials and examples instead of asking us to write your code for you?

Basic painting examples are here (http://doc.qt.io/qt-5/examples-painting.html).

More advanced Graphics / View examples are here (http://doc.qt.io/qt-5/examples-graphicsview.html).

For your problem, I think you will need to use a graphics / view approach. If you want to draw a line and then move it, the line needs to be a separate thing from the image it is drawn on. The graphics / view architecture is designed to use a scene, where everything you draw is a different item in the scene.


And don't double post. You asked this same question yesterday in a different thread. If you don't get an answer, it means no one wants to answer.