PDA

View Full Version : Trivial graphics view framework coordination problem



Miihkali
22nd May 2009, 13:03
I'm confused with the graphics view framework coordinate system. There is so much information about all kinds of conversions, relations, mappings etc. that I haven't been able to find out solution for my trivial problem.

The problem is: I want to draw my item so that it fills the view completely. How can I do this after I've scrolled the view? I don't want to use QGraphicsView::fitInView(), I just need to tell in my item's paint function that draw yourself and fill the whole view while doing it.

faldzip
24th May 2009, 00:15
you should operate in scene context, because it is not a widget itself, but the content of graphics view. So whatever you do with graphics view (scroll, change it size) the scene remains unchanged. So just make your item fill whole scene (it's bounding rect = 0, 0, scene.width, scene.height). And of course if you want to fill whole graphics view, the scene should cover at least graphics view viewport area.

wysota
24th May 2009, 08:51
Please don't start multiple threads on the same subject.

http://www.qtcentre.org/forum/f-newbie-4/t-graphics-view-coordinates-am-i-stupid-or-what-21233.html