Results 1 to 3 of 3

Thread: QPushbutton leave event

  1. #1
    Join Date
    Mar 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QPushbutton leave event

    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.

  2. #2
    Join Date
    Mar 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPushbutton leave event

    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.

  3. #3
    Join Date
    Nov 2009
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPushbutton leave event

    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.
    Gopikrishna

Similar Threads

  1. Qt widget enter/leave event
    By bunjee in forum Qt Programming
    Replies: 11
    Last Post: 28th April 2014, 03:09
  2. Mouse Leave and Tab Key event in Delegate
    By faldzip in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2008, 19:04
  3. Tooltip enter/leave event.
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2007, 11:46
  4. Replies: 3
    Last Post: 26th September 2006, 12:16
  5. Mouseover event on QPushButton
    By Twey in forum Newbie
    Replies: 2
    Last Post: 13th January 2006, 18:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.