Results 1 to 4 of 4

Thread: Get keyboard focus on mouse over (hover to activate)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Get keyboard focus on mouse over (hover to activate)

    Is there a generic way to enable window activation by mouse hovering? Some of my users benefit from a mode where the keyboard focus automatically follows the mouse -- moving over a window activates that window and it starts receiving keyboard events.

    I know I can do this simply by watching mouse events, but I also recall this used to be a standard interface behaviour on some systems. Thus I was wondering if QT had a toggle to enable such a mode without me having to code it on every window specially.

  2. #2
    Join Date
    Jul 2011
    Location
    Scotland
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Get keyboard focus on mouse over (hover to activate)

    I would be quite interested in this too? Did you ever find a solution?

    Also with your mouseMoveEvent solution, i take it i would have to enable mouseTracking, also check if mouse pos is within frameGeometry(), check isActiveWindow() is false then call activateWindow() ?

    Sorry if these questions sound stupid, i'm new to Qt.

  3. #3
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Get keyboard focus on mouse over (hover to activate)

    Quick answer: No, I never found a solution.

    On Linux I was able to get my method working reasonably, but on windows you can't steal keyboard focus. That's it, nothing you can do. Nothing Qt can do. Windows 7 has a global mode to enable this across all apps, but that isn't likely to be a popular option.

  4. #4
    Join Date
    Jul 2011
    Location
    Scotland
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Get keyboard focus on mouse over (hover to activate)

    Thanks for letting me know.

Similar Threads

  1. Hover on mouse over while dragging
    By mooreaa in forum Qt Programming
    Replies: 3
    Last Post: 6th February 2010, 10:31
  2. QSystemTrayIcon capture mouse hover event
    By alan in forum Qt Programming
    Replies: 2
    Last Post: 1st August 2009, 19:42
  3. segmentation fault on mouse hover
    By elessaar in forum Qt Programming
    Replies: 6
    Last Post: 26th August 2008, 12:51
  4. keyboard focus
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 27th June 2008, 15:40
  5. Replies: 2
    Last Post: 24th July 2006, 18:36

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.