PDA

View Full Version : how blocked center in QGraphicsScene



estel
20th March 2010, 02:51
hello,
for example I have QGraphicsScene size 500x500. I put line on cords: from (10,30) to (70,70) and i have no idea why line is on center of the scene, could you explain me why? Do you know how to off the "center" option?

Lykurg
20th March 2010, 07:14
its the default behavior. Use QGraphicsView::setAlignment() to change that.

estel
20th March 2010, 11:08
So there is no way to put the line exactly on coords from (10,30) to (70,70)? not alignt to center, not align to left but exactly from (10,30) to (70,70)

Lykurg
20th March 2010, 11:11
there is, as I have written! Just align the sceen via QGraphicsView::setAlignment() to the top left of your view and then when you draw the line from (10,30) to (70,70) it is displayed from (10,30) to (70,70).