PDA

View Full Version : Need some doc or help about widgets positions (coordinates)



aguayro
26th April 2012, 17:40
Hi, i've added a QListWidget to a QGraphicsScene, all is ok, but i'm confused about the coordinates.
I thought that x=0, y=0 was first top-left pixel, but if i do: QListWidget->move(0,0), its move to about 40 pixels from top and about 40 pixels from left, i'm really confused about this.
I've tryed to find some doc about positions or something but no luck for now.
Somebody could help me with a link or something?
Thanks

sedi
26th April 2012, 19:26
The QGraphicsScene has a coordinate system of it's own, so has the QGraphicsView. You can translate between the systems (global, vieweport, scene) by using the ->mapFrom... and ->mapTo... methods of view or scene.

Furthermore, the scene is just some virtual model where you can place things on. To see it, you use the view - and the latter can show whatever part of the scene you choose.

As I am still struggling with my own problems regarding scene geometry and centering I don't try to be more specific than I think I can sensibly be - if this doesn't help, the experts here might be a source of deeper wisdom :-)

aguayro
26th April 2012, 21:31
thanks!! thath helped a lot :)