replace some control characters for display in ui
QT fails if nul byte is in string.
This commit is contained in:
@@ -422,6 +422,14 @@ class InnerBigText(QWidget):
|
|||||||
y_line_offset = self.char_height;
|
y_line_offset = self.char_height;
|
||||||
for l in self.lines:
|
for l in self.lines:
|
||||||
text = l.line_tabs_replaced()
|
text = l.line_tabs_replaced()
|
||||||
|
text = text.replace("\0", "␀") # qt throws error if we try to draw a null character
|
||||||
|
text = text.replace("\1", "␁")
|
||||||
|
text = text.replace("\2", "␂")
|
||||||
|
text = text.replace("\3", "␃")
|
||||||
|
text = text.replace("\4", "␄")
|
||||||
|
text = text.replace("\5", "␅")
|
||||||
|
text = text.replace("\6", "␆")
|
||||||
|
text = text.replace("\a", "␇")
|
||||||
painter.drawText(left_offset, y_line_offset, text)
|
painter.drawText(left_offset, y_line_offset, text)
|
||||||
y_line_offset = y_line_offset + self.char_height
|
y_line_offset = y_line_offset + self.char_height
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user