<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setDocument(self, filename, empty=""):
 """Sets the HTML text to be displayed. """

        self._source = QUrl.fromLocalFile(filename)
        if os.path.exists(filename):
            self.viewer.setSource(self._source)
        else:
            self.viewer.setText(empty)