[Qt-interest] translate path's coordinates

Ioannis Nousias s0238762 at sms.ed.ac.uk
Mon Jun 8 00:35:10 CEST 2009


Hello qt-devs

Is there a way to change where a path is drawn? I've tried setting the 
world matrix on the painter, but that did something I was not expecting. 
The path got deformed.

Basically, I have a little drawing tool. You draw shapes/paths with your 
mouse. Each time you press the mouse button it starts a new path and 
continues 'adding' to that path until you release the button. The paths 
are stored in a list.

When you hover over a path (the cursor is atop its contour), the shape 
is highlighted and you are suppose to be able to move it around. I use 
QPainterPathStroker and contains() to detect if the mouse is over a path.

Any ideas? Is there some other neater way to do this whole thing (maybe 
using QGraphicsView and QGraphicsItem's or something. At the moment I 
just draw things on a QWidget)

regards,
Ioannis


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the Qt-interest-old mailing list