Results 1 to 4 of 4

Thread: Qt::WA_TransparentForMouseEvents

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2006
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt::WA_TransparentForMouseEvents

    Our desktop app has an overlay over the main window with an "aperture" that is made transparent to mouse events by setting the Qt::WA_TransparentForMouseEvents attribute. This used to work well in an earlier version based on Qt 5.9.8.

    We have migrated to Qt 6.2.3, and the event pass-through has stopped working on Linux (ubuntu 20.04) and MacOS, but continues to work on Windows.

    I assume the attribute is ultimately handled by the window manager. Is this assumption correct?
    Could the propagation of the attribute to the window manager possibly have changed between Qt 5.9.8 and Qt 6.2.3?

    How can I even test this hypothesis? So far I can only confirm that mouse clicks are not consumed by the "underneath" widget as they should be (and are on Windows).

    Are there other ways to achieve z-order event transparency for a widget?
    Last edited by zaphod.b; 23rd May 2022 at 15:11.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt::WA_TransparentForMouseEvents

    Are there other ways to achieve z-order event transparency for a widget?
    As a workaround, you might be able to install an event handler on the overlay that relays the mouse events to the underlying widget. You'll probably need to do some coordinate mapping if the overlay is not exactly the same size and in the same position.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

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.