<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_as_error(self, color=Qt.red):
 """ Highlights text as a syntax error. :param color: Underline color :type color: QtGui.QColor """

        self.format.setUnderlineStyle(
            QTextCharFormat.WaveUnderline)
        self.format.setUnderlineColor(color)