Overloads the drawDisplay method to render HTML if the rich text \
        information is set to true.
        
        :param      painter | <QtGui.QPainter>
                    option  | <QtGui.QStyleOptionItem>
                    rect    | <QtCore.QRect>
                    text    | <str>

def drawDisplay(self, painter, option, rect, text):
        """
        Overloads the drawDisplay method to render HTML if the rich text \
        information is set to true.
        
        :param      painter | <QtGui.QPainter>
                    option  | <QtGui.QStyleOptionItem>
                    rect    | <QtCore.QRect>
                    text    | <str>
        """
        if self.showRichText():
            # create the document
            doc = QtGui.QTextDocument()
            doc.setTextWidth(float(rect.width()))
            doc.setHtml(text)
            
            # draw the contents
            painter.translate(rect.x(), rect.y())
            doc.drawContents(painter, QtCore.QRectF(0, 
                                                    0, 
                                                    float(rect.width()), 
                                                    float(rect.height())))
                                             
            painter.translate(-rect.x(), -rect.y())
        else:
            if type(text).__name__ not in ('str', 'unicode', 'QString'):
                text = nativestring(text)
            
            metrics = QtGui.QFontMetrics(option.font)
            text = metrics.elidedText(text,
                                      QtCore.Qt.TextElideMode(option.textElideMode),
                                      rect.width())
            
            painter.setFont(option.font)
            painter.drawText(rect, int(option.displayAlignment), text)