title: Drawing points on QPixmap on QWidget (pyqt5)
body: <p>I have a QWidget with a QLayout on which there is a QLabel.
  I set a QPixmap on the label. Wherever the user clicks on the image, I want to draw a point. I defined mouseReleaseEvent (which works) and paintEvent (but no points are drawn). I've read all similar questions and none of the solutions worked for me. Any help? My relevant code:</p>
  
  <pre><code>class ImageScroller(QtWidgets.QWidget):
  
      def __init__(self, img):
          QtWidgets.QWidget.__init__(self)
          main_layout = QtWidgets.QVBoxLayout()
          self._image_label = QtWidgets.QLabel()
          self._set_image(img)
          main_layout.addWidget(self._image_label)
          main_layout.addStretch()
          self.setLayout(main_layout)
  
      def _set_image(self, img):
          img = qimage2ndarray.array2qimage(img)
          qimg = QtGui.QPixmap.fromImage(img)
          self._img_pixmap = QtGui.QPixmap(qimg)
          self._image_label.show()
  
      def paintEvent(self, paint_event):
          painter = QtGui.QPainter(self)
          painter.begin(self)
          painter.setPen(QtGui.QPen(QtCore.Qt.red))
          pen = QtGui.QPen()
          pen.setWidth(20)
          painter.setPen(pen)
          painter.setRenderHint(QtGui.QPainter.Antialiasing, True)
          painter.drawPoint(300,300)
          painter.drawLine(100, 100, 400, 400)
          for pos in self.chosen_points:
              painter.drawPoint(pos)
          painter.end()
  
      def mouseReleaseEvent(self, cursor_event):
          self.chosen_points.append(QtGui.QCursor().pos())
          self.update()
  </code></pre>