Creating new scene from a part of an old one
Hi gusy,
I have a scene with custom background showing the world. When I zoom In the coordinates system changes and the whole scene is zoomed In. I choose a rectangle which should be zoomed and use "QGraphcsView::fitInView(QRectF)". But this work to slow and I do not want to zoom in the whole scene, especially when only the chosen(zoomed) rect will be visible. I thaught about creating a new scene from the chosen rectangle, hiding the (whole world scene) and setting View's new scene,etc.
First of all, I would like to ask do you think this is a good idea? If not, I would really appreciate if you could share your other ideas.
If this approach is ok, howto create a new scene from a part of the old scene? (the new scene should show the part of old scene background + items from that area).
Thank you for any help.
P.S.
Yet zooming in the whole world is just to slow.
Re: Creating new scene from a part of an old one
What is causing the slowdown? If you zoom the view, items are not changed and those outside the visible rectangle are not affected in any way... You should have an increase in speed, not a slowdown...
Re: Creating new scene from a part of an old one
Still, it works slower. Will look at the code and give more details.
Re: Creating new scene from a part of an old one
Do you cache the background?
Re: Creating new scene from a part of an old one
yes, because the background is built of about 3000 polygons,
Re: Creating new scene from a part of an old one
I suggest you use cachegrind or gprof to find the bottleneck.
Re: Creating new scene from a part of an old one
will do as suggested and reply later.