Results 1 to 2 of 2

Thread: QMenu focusOut event

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default QMenu focusOut event

    Hello,
    I have a problem with focus out event in QMenu subclass.

    The problem is as fallow:
    I have QSystemTrayIcon and on it QMenu. MainWindow is hidden so It don't receive any events.
    What I want to do is to hide QMenu when user click outside of QMenu.

    I tried focusOutEvent but this is not trigered when I click outside of QMenu (QMenu has on show: setFocus( Qt::MouseFocusReason ) and setFocusPolicy( Qt::StrongFocus ) ).

    So the question how to hide menu assigned to QSystemTrayIcon when user clicks outside of that menu?
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QMenu focusOut event

    Solved main problem.

    It turns out that parent of QMenu caused this behaviour. Parent was hidden and probably prevent QMenu to receive signals.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

Similar Threads

  1. QMenu is not getting shown properly until any event occurs.
    By sanket.mehta in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2011, 15:39
  2. Timer event & paint event, priority
    By Teuniz in forum Qt Programming
    Replies: 0
    Last Post: 2nd February 2010, 13:33
  3. Replies: 10
    Last Post: 15th January 2010, 14:35
  4. Replies: 0
    Last Post: 23rd October 2008, 12:43
  5. focusOut- event issue
    By gunhelstr in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2006, 08:02

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.