Qt - top level widget with keyboard and mouse event transparency?

后端 未结 6 1944
逝去的感伤
逝去的感伤 2020-12-05 02:27

I want an app\'s main window to ignore mouse and keyboard events, passing them to applications underneath it in the window manager Z-order.

I see

6条回答
  •  不知归路
    2020-12-05 02:53

    I found the following solution (tested on Linux, also works on Windows according to @TheSHEEEP):

    setWindowFlags(windowFlags() | Qt::WindowTransparentForInput);
    

    It has been added in more recent qt release (i did not find when) see http://doc.qt.io/qt-5/qt.html

提交回复
热议问题