code: def paintEvent(self, event):
          
          if not self.toPlainText() and not self.hasFocus() and self._placeholder:
              p = QtGui.QPainter(self.viewport())
              p.setClipping(False)
              col = self.palette().text().color()
              col.setAlpha(128)
              oldpen = p.pen()
              p.setPen(col)
              p.drawText(self.viewport().geometry(), QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop, self._placeholder)
              p.setPen(oldpen)
          else:
              return super(JB_PlainTextEdit, self).paintEvent(event)
docs: Paint the widget
  
          :param event:
          :type event:
          :returns: None
          :rtype: None
          :raises: None