PDA

View Full Version : Drop polygons in a QGraphicsView



qlands
6th May 2010, 13:52
Hi I have an application that polygons in a QGraphicsView.

When I Maximize the window and check the values of X and Y for both the View and the Scene I have the following values: Top-Left of view (1,1) Bottom-Right of view (1005,739); Top-Left of scene (-500,-368), Bottom-right of scene (500,368).

Now, when I drag and drop an polygon in the view it gives me position between the Top-Left and the Bottom-Right but when I pass this values to the scene it places the polygon somewhere else (because of the difference is coordinates).

How can I solve this problem? Is there any way to change the coordinate of the scene to be the same of the view? or I need to transform the values of the view to fit the coordinate of the scene?

Many Thanks