From: Bas Pape Date: Sat, 28 Dec 2013 12:07:30 +0000 (+0100) Subject: Preserve white-space in the input history. X-Git-Tag: 0.12.3~33 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=fc63ab287880f16f24a0a30793fec3f52cdd58d8 Preserve white-space in the input history. By default QTextHtmlImporter::appendNodeText replaces white-space characters with a single space and leading white-space is removed. When white-space is set to pre-wrap in the style of the node, it is preserved instead. Given that contents are in a span element, setting white-space to pre-wrap on span makes the setHtml call do the expected thing. --- diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp index 7e89f499..37f1f62a 100644 --- a/src/uisupport/multilineedit.cpp +++ b/src/uisupport/multilineedit.cpp @@ -55,6 +55,9 @@ MultiLineEdit::MultiLineEdit(QWidget *parent) setLineWrapEnabled(false); reset(); + // Prevent QTextHtmlImporter::appendNodeText from eating whitespace + document()->setDefaultStyleSheet("span { white-space: pre-wrap; }"); + connect(this, SIGNAL(textChanged()), this, SLOT(on_textChanged())); _mircColorMap["00"] = "#ffffff";