title: PyQt: How to set a mask over a QWidget to ignore mouse events but get the children events
body: <p>I want to <strong>overlap</strong> widgets and make them all functional, but I can't get this done through simple layout management. I found an example applying a mask over the widget, but is in <strong>C++</strong> and I am having a hard time trying to port it to <strong>python</strong>.</p>
  
  <p>The example is in this article:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/27855137/how-to-disable-the-delivery-of-mouse-events-to-the-widget-but-not-its-children-i">How to disable the delivery of mouse events to the widget but not its children in Qt?</a></li>
  </ul>
  
  <p>That's exactly what I need, and I'm trying to implement it in my code. But I get the error: </p>
  
  <pre><code>NotImplementedError: reverse operator not implemented
  </code></pre>
  
  <p>How could I solve this?</p>
  
  <p>A very simple example of what I'm doing in the code:</p>
  
  <pre><code>from PySide import QtCore as qc
  from PySide import QtGui as qg
  import operator
  ###############################################################
  class WinDin(qg.QDialog):
      def __init__(self):
          super(WinDin, self).__init__()
          self.setLayout(qg.QVBoxLayout())
          self.setFixedSize(500,500)
  
          button_00 = qg.QPushButton('death')
          self.layout().addWidget(button_00)
  
          ##################################################
          # IM USING A QLABEL FOR EASY LOOK THROUGH ...
          #
          self._mainWidget = qg.QLabel(self)
          self._mainWidget.setFixedSize(500,500)
          self._mainWidget.setStyleSheet("background-color: rgba(255,0,0,5)")
  
          lay_out = qg.QHBoxLayout(self._mainWidget)
          button_01 = qg.QPushButton('trick')
  
          lay_out.setAlignment(qc.Qt.AlignBottom)
          lay_out.addWidget(button_01)
  
          self.settingMask()
      ############################################################################################################################################
      def settingMask(self):
          ### SAW THIS EXAMPLE IN OTHER FORO IN C++
  
          frame_geometry = self._mainWidget.frameGeometry()
          wd_geo = self._mainWidget.geometry()
          child_reg = self._mainWidget.childrenRegion()
  
  
          ##############################
          # TESTING WITH OPERATOR MODULE I GET AND ERRROR . 'PySide.QtCore.QRect' is not iterable
          #
          #this = operator.__contains__(wd_geo,wd_geo)
          #self._mainWidget.setMask(this)
  
          self._mainWidget.setMask(frame_geometry - child_reg)
  
          ###
          ###
          ###  THIS WAY I GET : NotImplementedError: reverse operator not implemented.
  
  ##########################################
  def main():
      import sys
      qtApp=qg.QApplication(sys.argv)
      myWinPos=WinDin()
      myWinPos.show()
      sys.exit(qtApp.exec_())
  
  if __name__=="__main__":
      main()
  </code></pre>
  
  <p>How can I subtract the <strong>children</strong> geometry from the <strong>parent</strong> and make it work?</p>