I have what is potentially a silly/nonsensical question -- is it possible to change the mouse grabbing behavior in Qt so that when the mouse leaves a widget (i.e. the mouse is no longer on the widget) the widget stops grabbing the mouse (regardless of whether or not all the mouse buttons have been released)?

My specific example is as follows: I'm trying to design an interface for a touch screen, with several buttons. If a user presses down on one of the buttons, but realizes it's the wrong button, I'd like them to be able to move their finger to the correct button and then relase to click that button. In more detail:
  1. User clicks down on the wrong button -- that button grabs the mouse and appears to be pressed down
  2. User realizes it's the wrong button, and without releasing, moves to the correct button
  3. The wrong button is no longer pressed down, and releases the mouse
  4. The correct button appears to be pressed down when the still clicked down mouse is moved on top of it
  5. The user releases the mouse button, and the correct button is clicked


Does this make sense? The behavior I'm looking for is basically that of the iPhone's on-screen keyboard, if that helps...

Thanks in advance for any help or advice anyone can give me!

- The FSD