code: def set_as_error(self, color=Qt.red):
          
          self.format.setUnderlineStyle(
              QTextCharFormat.WaveUnderline)
          self.format.setUnderlineColor(color)
docs: Highlights text as a syntax error.
  
          :param color: Underline color
          :type color: QtGui.QColor