From 84e15d1ee20bd0c450610976439dd35a7f009d89 Mon Sep 17 00:00:00 2001 From: Markus Neugebauer Date: Tue, 27 Jul 2021 21:45:34 +0200 Subject: [PATCH] Trim the newline-chars instead of removing of 2 chars --- include/spdlog/sinks/qt_sinks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/qt_sinks.h b/include/spdlog/sinks/qt_sinks.h index 5a9a83da7..f6e0b684c 100644 --- a/include/spdlog/sinks/qt_sinks.h +++ b/include/spdlog/sinks/qt_sinks.h @@ -39,7 +39,7 @@ class qtextedit_sink_p : public QObject void append(const spdlog::string_view_t &str) { - emit append_text(QString::fromUtf8(str.data(), static_cast(str.size() - 2))); + emit append_text( QString::fromUtf8(str.data(), static_cast(str.size())).trimmed() ); } signals: @@ -69,7 +69,7 @@ class qplaintextedit_sink_p : public QObject void append(const spdlog::string_view_t &str) { - emit append_text(QString::fromUtf8(str.data(), static_cast(str.size() - 2))); + emit append_text( QString::fromUtf8(str.data(), static_cast(str.size())).trimmed() ); } signals: