[Qt-interest] How to solve grabmouse issue

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Wed Jul 28 16:42:11 CEST 2010


Ramesh wrote on Wednesday, July 28, 2010 3:49 PM:

> No,
> User doesn't press anything.. 

Is that a statement, merely an observation or a design decision that the user MUST NOT press anything? ;)

I was SUGGESTING that COULD be the solution IF you insist on your first widget grabbing the mouse. That is the whole idea of grabbing the mouse, that OTHER widgets DON'T get informed about mouse events.

> he just perform mouse operation in one
> graphics item and soon after that He will switch to another
> graphicsitem of same scene.. this situation may arise right? 

Yes. So? The other widget WON'T get mouse events, unless you do something programmatically (e.g. triggered by the user in some way, as I suggested already by hitting "Esc" or whatever).
 
> "How can I send mouse events to scene from the graphicsitem. Atlease
> can you tell me that?" I can try This last option 

Simply put: you CAN'T! That's the whole point of grabbing the mouse - unless your first widget RELEASES the mouse. WHEN and HOW this is to be done is entirely up to you(r GUI/interaction design).

But as already suggested by someone else: do you really NEED to grab the mouse? Since you want other widgets to receive mouse events as well (as soon as the mouse hovers over them) it sounds like your design is broken.

Does that help?

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list