Improve handling of country/prefix information appended to decoded CQ messages

The  use  of  QTextEdit::toPlainText() converts  non-break  spaces  to
normal spaces so  was breaking the use of that  character to delineate
appended info. Since using  QTextEdit::toPlainText() is an unnecessary
operation as  the decoded text  can be more amenably  accessed through
the QDocument  and QTextBlock interface without  any translation, this
is an improvement which should  have some performance impact when many
decodes are stored in the decodes windows.
This commit is contained in:
Bill Somerville
2018-09-28 16:12:09 +01:00
parent c2c977976c
commit da643fa43e
3 changed files with 23 additions and 27 deletions
+1
View File
@@ -76,6 +76,7 @@ void DisplayText::insertLineSpacer(QString const& line)
void DisplayText::appendText(QString const& text, QColor bg,
QString const& call1, QString const& call2)
{
qDebug () << "DisplayText::appendText: text:" << text << "Nbsp pos:" << text.indexOf (QChar::Nbsp);
auto cursor = textCursor ();
cursor.movePosition (QTextCursor::End);
auto block_format = cursor.blockFormat ();