Results 1 to 14 of 14

Thread: QMessageBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    47
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post Re: QMessageBox

    Actually when i press enter to close the messagebox.Eventfilter in my class is getting called again and messagebox is getting displayed again.
    How to differenciate between the enter that i pressed to close the messagebox and the ordinary enter that i press ...

  2. #2
    Join Date
    Aug 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Lightbulb Re: QMessageBox

    This is rather old post but here’s why this is happening in case someone else has a same problem. When you press a key on keyboard (and release it, thus actually making one “click” of that key) there are two events emitted. QEvent::KeyPress and then QEvent::KeyRelease. The first one closes the message box and object that gets the focus (after closing message box) also gets QEvent::KeyRelease called for it, which causes that object to “think” that key was pressed inside it. Filter out QEvent::KeyRelease event for object that can get focus after message box closes. Worked for me

Similar Threads

  1. Re: Help on QMessageBox
    By arunvv in forum Newbie
    Replies: 2
    Last Post: 25th March 2008, 23:45
  2. QMessageBox problem in Qtopia
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 8th February 2008, 09:22
  3. QMessageBox - no dialog title on Mac OS?
    By will49 in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2007, 14:07
  4. customize the Icon QMessageBox
    By QiT in forum Newbie
    Replies: 1
    Last Post: 26th August 2006, 10:40
  5. Change icons on static QMessageBox
    By manucorrales in forum Qt Programming
    Replies: 1
    Last Post: 22nd July 2006, 19:00

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
  •  
Qt is a trademark of The Qt Company.