Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81456

QGraphicsView with Qt::WA_TranslucentBackground + Qt::WindowStaysOnTopHint no longer let mouse events pass through the background

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.13.1, 5.14.2, 5.15.1
    • Widgets: GraphicsView
    • None
    • macOS

    Description

      Context : Migrating code from Qt5.5 to Qt 5.13

      The same code that still works on Linux and Windows no longer works on Mac (it worked with Qt 5.5) : 

       

      mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
      #ifdef Q_OS_OSX
          mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
      #endif
      mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint | Qt::X11BypassWindowManagerHint);
      
      

      The expected result is that the mouse events can pass through the transparent background, like in Ubuntu, and Windows. 

      Issue encountered on 10.14.6 (but same issue with Qt 5.9.5 and High Sierra)

       As you can see below, I can see QtCreator behind the transparent background, but I can't click though the background and interact with QtCreator. When I try to click on, the Mac menus and docks disappear and nothing happens, like if I had clicked on the background or in an object on the background.

       

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bibr Andreas Aardal Hanssen
            kamui kamui
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes