[Qt-interest] QGraphicsItem ignore scene translation/transform?
Samuel Rødal
samuel.rodal at nokia.com
Fri Jan 22 14:31:40 CET 2010
ext Thomas Fjellstrom wrote:
> On Fri January 22 2010, Samuel Rødal wrote:
>> Basically the
>> top-level item is just an invisible item whose bounding rect is the same
>> as the combined bounding rect of the child items (game squares).
>> Whenever you earlier scaled / scrolled the view itself you'd now do the
>> same with the top level item. You might wish to use
>> QGraphicsScene::setSceneRect() to control which part of the scene should
>> be mapped to the view at any time.
>>
>> I don't think this way of doing things should be significantly harder
>> than changing the view transformation.
>
> But how to actually handle the events is something else. Right now the child
> widgets all accept mouse events, which means the parent widget doesn't get
> them, so it can't know when a person is trying to scroll or zoom.
>
> I'm not sure how to have both, selecting the game elements, AND letting the
> game board accept events to handle scrolling and zooming.
Not sure I understand from where you're currently triggering scrolling
and zooming. Does each game square currently tell the view it needs to
scroll or zoom? If so, can't you keep the current design but instead
tell the invisible game board item to scroll / zoom?
> I find it odd that your messages to the list aren't getting through right
> away while mine are. Is there something up with the mailing list?
Looks like there's some kind of delay, yes, but I don't know what's
causing it.
More information about the Qt-interest-old
mailing list