diff --git a/UI/log-viewer.cpp b/UI/log-viewer.cpp index 021450069..18702e3f4 100644 --- a/UI/log-viewer.cpp +++ b/UI/log-viewer.cpp @@ -27,6 +27,9 @@ OBSLogViewer::OBSLogViewer(QWidget *parent) : QDialog(parent) textArea = new QPlainTextEdit(); textArea->setReadOnly(true); textArea->setFont(fixedFont); + // Fix display of tabs & multiple spaces + textArea->document()->setDefaultStyleSheet( + "font { white-space: pre; }"); QHBoxLayout *buttonLayout = new QHBoxLayout(); QPushButton *clearButton = new QPushButton(QTStr("Clear")); @@ -112,7 +115,7 @@ void OBSLogViewer::InitLog() cursor.beginEditBlock(); while (!in.atEnd()) { QString line = in.readLine(); - cursor.insertHtml(line); + cursor.insertText(line); cursor.insertBlock(); } cursor.endEditBlock(); @@ -136,6 +139,9 @@ void OBSLogViewer::AddLine(int type, const QString &str) case LOG_ERROR: msg = QString("%1").arg(msg); break; + default: + msg = QString("%1").arg(msg); + break; } QScrollBar *scroll = textArea->verticalScrollBar();