code: def paintEvent(self, event):
          
          painter = QPainter(self)
          painter.fillRect(event.rect(), self.palette().color(QPalette.Window))
  
          block = self._qpart.firstVisibleBlock()
          blockBoundingGeometry = self._qpart.blockBoundingGeometry(block).translated(self._qpart.contentOffset())
          top = blockBoundingGeometry.top()
          bottom = top + blockBoundingGeometry.height()
  
          for block in qutepart.iterateBlocksFrom(block):
              height = self._qpart.blockBoundingGeometry(block).height()
              if top > event.rect().bottom():
                  break
              if block.isVisible() and \
                 bottom >= event.rect().top():
                  if block.blockNumber() in self._qpart.lintMarks:
                      msgType, msgText = self._qpart.lintMarks[block.blockNumber()]
                      pixMap = self._lintPixmaps[msgType]
                      yPos = top + ((height - pixMap.height()) / 2)  # centered
                      painter.drawPixmap(0, yPos, pixMap)
  
                  if self.isBlockMarked(block):
                      yPos = top + ((height - self._bookmarkPixmap.height()) / 2)  # centered
                      painter.drawPixmap(0, yPos, self._bookmarkPixmap)
  
              top += height
docs: QWidget.paintEvent() implementation
          Draw markers