From bf9fd9d4ef7e565d569958176a8cf889b7f01ff5 Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Wed, 14 Sep 2011 15:40:36 +0200 Subject: [PATCH] allow HTML in the scene message \n newline characters are automatically converted to
--- sloth/gui/annotationscene.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sloth/gui/annotationscene.py b/sloth/gui/annotationscene.py index a0b74c0..56bc73a 100644 --- a/sloth/gui/annotationscene.py +++ b/sloth/gui/annotationscene.py @@ -345,9 +345,9 @@ class AnnotationScene(QGraphicsScene): if message is None or message == "": return - # TODO don't use text item at all, just draw the text in drawForeground - self._message = message - self._message_text_item = QGraphicsSimpleTextItem(message) + self._message = message.replace('\n', '
') + self._message_text_item = QGraphicsTextItem() + self._message_text_item.setHtml(self._message) self._message_text_item.setPos(20, 20) self.invalidate(QRectF(), QGraphicsScene.ForegroundLayer)