PDA

View Full Version : QPushbutton leave event



mikec
25th April 2010, 16:16
I writing some software that emulates the keyboard on a Stylophone on N900. I want to be able to slide my finger across all the keys and have them play as I traverse them.

At the moment when I touch the button, it plays a sound.
On the N900 the touch creates signal for button pressed. so far so good.
The trouble is that Qt still thinks the mouse button is pressed, so the next button never gets the event.

the strange thing is that the sound stops playing when my finger slides off the button and plays again when I slide back on. so its getting the a released and pressed event for that initial button, but I cant force it to release the button.

any clues on how best to deal with this. I'm not sure subclasssing will help as it would still have the mouse pressed event on the initial button.

mikec
25th April 2010, 19:48
Just to reply to myself. I think what I need is to disable the mouse grabber on a widget, but be able to get the mouse enter and leave events.

gopikrishnav
26th April 2010, 08:38
Probably you can use MouseOverEvent to solve this problem. Create your own customize class like MyPushButton derived from QPushButton and override the MouseOverEvent for it.

In the MouseOverEvent call the method that will invoke your button functionality. I hope it will serve the purpose.