AFT.reset(); // AFT is a Qtranform
AFT.translate(scrollh, scrollv); // pixles
AFT.scale(escalex, -escaley); // escale = widget pixels siz e / world
AFT.translate(-xc, -yc); // center of my world
AFT.reset(); // AFT is a Qtranform
AFT.translate(scrollh, scrollv); // pixles
AFT.scale(escalex, -escaley); // escale = widget pixels siz e / world
AFT.translate(-xc, -yc); // center of my world
To copy to clipboard, switch view to plain text mode
I have two private vars double real_x, real_y;
And at mousemove event
mouse_x = event->pos().x(); mouse_y = event->pos().y();
AFT.map(mouse_x,mouse_y, &real_x, &real_y);
mouse_x = event->pos().x(); mouse_y = event->pos().y();
AFT.map(mouse_x,mouse_y, &real_x, &real_y);
To copy to clipboard, switch view to plain text mode
My world is : -70,70,30,30 (xmin,xmax, ymin,ymax) , a widget size of 600x300 and center of my world 0,800.
I draw a line from -70,790 to 70,810 without any problem
I have real coords in range : 300 3000 (x) 3200 - 4000 ?????
My code was exactly as one I have developed on Java. Java has AFT.inversetransform (and it worked fine )
Thanks.
Bookmarks