def _add_image(self, image):
document = self._control.document()<EOL>name = str(image.cacheKey())<EOL>document.addResource(QtGui.QTextDocument.ImageResource,<EOL>QtCore.QUrl(name), image)<EOL>format = QtGui.QTextImageFormat()<EOL>format.setName(name)<EOL>return format<EOL>
Adds the specified QImage to the document and returns a
            QTextImageFormat that references it.