1

I'm using a QDialog with transparency enabled to select a region of the screen for a screen capture tool. When the user clicks inside the transparent widget I want to ignore the mouse event so that the system handles it. Is this possible?

I'm trying to achieve this on Linux.

Some things I have tried with no success:

  • QtWidgets.QWidget.setWindowFlags(QtCore.Qt.WindowTransparentForInput)
  • QtWidgets.QWidget.setAttribute(QtCore.Qt.WA_TransparentForMouseEvents)
  • QtWidgets.QWidget.setMask(QtGui.QRegion(self.geometry()))
  • Subclassing mousePressEvent and ignoring the event
4

1 に答える 1