title: PyQt5: QPainter overlay QWidget
body: <p>To this question I am referring to the answer from @Kuba Ober  <a href="https://stackoverflow.com/questions/19199863/draw-rectangular-overlay-on-qwidget-at-click">Draw Rectangular overlay on QWidget at click</a></p>
  
  <p><strong>My problem:</strong> I dont know how to "translate" the C++ (or C?) into Python. :-(</p>
  
  <p>Thus I ask this "duplicated" question again, and wish anyone would help to rewrite the code to achieve the overlay effect in PyQt5. </p>
  
  <p>As an example, I prepare here some code:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  import sys
  from PyQt5.QtWidgets import *
  from PyQt5.QtGui import *
  from PyQt5.QtCore import *
  
  class MyApp(QWidget):
      def __init__(self):
          super(MyApp, self).__init__()
          self.initUI()
  
      def initUI(self):
          self.text = "hello world"
          self.setGeometry(100, 100, 400, 300)
          self.setWindowTitle('Draw Demo')
  
          self.btn = QPushButton("Butten should be overlayed", self)
          self.btn.setFixedSize(200, 200)
          self.btn.move(40, 40)
  
          self.show()
  
      def paintEvent(self, event):
          qp = QPainter()
          qp.begin(self)
          qp.setPen(QColor(Qt.red))
          qp.setFont(QFont('Arial', 20))
  
          qp.drawText(10, 50, "hello Python")
          qp.setPen(QColor(Qt.blue))
          qp.drawLine(10, 100, 100, 100)
          qp.drawRect(10, 150, 150, 100)
  
          qp.setPen(QColor(Qt.red))
          qp.drawEllipse(100, 50, 100, 50)
  #        qp.drawPixmap(220, 10, QPixmap("python.jpg"))
          qp.fillRect(200, 175, 150, 100, QBrush(Qt.SolidPattern))
          qp.end()
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      window = MyApp()
      window.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p><strong>Target is:</strong> Let the Button shown in the background (overlayed by QPainter), but it is transparent to mouse event. Thus I could click the button, even though it is covered by QPainter.</p>
  
  <p>Any help will be highly appreciated!</p>