def METHOD_NAME(self):
    QMessageBox = QtWidgets.QMessageBox
    if self._get() != self._savedcontent:
        ok = QMessageBox.question(None, "Save?", "Save changes?",
                                  QMessageBox.Yes | QMessageBox.No |
                                  QMessageBox.Cancel, QMessageBox.Yes)
        if ok == QMessageBox.Yes:
            self.doSave()
        elif ok == QMessageBox.Cancel:
            return False
    return True