def METHOD_NAME(self):
    if self.superscriptButton.isChecked():
        self.subscriptButton.setChecked(False)
        self.format.setVerticalAlignment(QtGui.QTextCharFormat.AlignSuperScript)
    else:
        self.format.setVerticalAlignment(QtGui.QTextCharFormat.AlignNormal)
    self.textEdit.setCurrentCharFormat(self.format)
    self.textEdit.setFocus()