From 0cf01f124897c2396e5b90877206e2a135716c89 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 8 Dec 2023 15:32:40 -0500 Subject: [PATCH] Correct a flaw in setting QMAP background colors. --- qmap/mainwindow.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index cfbd012fd..42b1ac0d9 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -941,18 +941,24 @@ void MainWindow::guiUpdate() t1="-"; ui->decodedTextBrowser->append(t1.repeated(56)); m_nline++; + QTextCursor cursor(ui->decodedTextBrowser->document()->findBlockByLineNumber(m_nline-1)); + QTextBlockFormat f = cursor.blockFormat(); + f.setBackground(QBrush(Qt::white)); + cursor.setBlockFormat(f); } m_UTC0=t.left(4); t=t.trimmed(); ui->decodedTextBrowser->append(t); m_fetched++; m_nline++; + QTextCursor cursor(ui->decodedTextBrowser->document()->findBlockByLineNumber(m_nline-1)); + QTextBlockFormat f = cursor.blockFormat(); if(t.mid(36,2)=="30") { - QTextCursor cursor(ui->decodedTextBrowser->document()->findBlockByLineNumber(m_nline-1)); - QTextBlockFormat f = cursor.blockFormat(); f.setBackground(QBrush(Qt::yellow)); - cursor.setBlockFormat(f); + } else { + f.setBackground(QBrush(Qt::white)); } + cursor.setBlockFormat(f); } } t1="";