PDA

View Full Version : How to don't fitInView a QGraphicsItem



jano_alex_es
26th October 2009, 12:11
Hi,

in my app some QGraphicsItems are created when the user clicks on the scene, and my idea is to create it in the place the user's click.

But, the view moves and it's created on the center of the screen (if there are no other items), is ok for other items, but not specifically for those.

I was checking fitInView and ensureVisible, but they do the opposite.

thanks!

zgulser
26th October 2009, 14:21
Hi,

If it's moving then , after each movement you need to re-set the positions of your existing items currently in the scene one by one. Have you ever tried it?

jano_alex_es
26th October 2009, 14:52
mmmh... yep, it could be a solution; but if Qt has "ensureVisible" and "center()" and all of this stuff it should have something to disable those functions. Because my problem is not the position of my items, I think my problem comes because any automatic function of the view or a flag I'm not able to find or something like that.