From d07caaf601c7f6ac6bc2534d2dadbb90a23ea00f Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 13 Jun 2019 17:03:12 +0200 Subject: [PATCH] qt msgbox: when using rich text, set text format to "AutoText" instead "\n" newlines were ignored for WIF_HELP_TEXT InfoButtons --- electrum/gui/qt/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qt/util.py b/electrum/gui/qt/util.py index 9ac6649ca..b64223a1d 100644 --- a/electrum/gui/qt/util.py +++ b/electrum/gui/qt/util.py @@ -258,7 +258,11 @@ def custom_message_box(*, icon, parent, title, text, buttons=QMessageBox.Ok, d.setDefaultButton(defaultButton) if rich_text: d.setTextInteractionFlags(Qt.TextSelectableByMouse | Qt.LinksAccessibleByMouse) - d.setTextFormat(Qt.RichText) + # set AutoText instead of RichText + # AutoText lets Qt figure out whether to render as rich text. + # e.g. if text is actually plain text and uses "\n" newlines; + # and we set RichText here, newlines would be swallowed + d.setTextFormat(Qt.AutoText) else: d.setTextInteractionFlags(Qt.TextSelectableByMouse) d.setTextFormat(Qt.PlainText)