Skip to content

Commit fd9c78b

Browse files
author
Mich
committed
Fixed highlighting on linux
1 parent a98a596 commit fd9c78b

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/mainwindow.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,19 +1385,16 @@ void MainWindow::on_highlighLog(QString searchString)
13851385
{
13861386
QTextDocument *document = ui->textBrowserLogs->document();
13871387
QTextCursor highlightCursor(document);
1388-
QTextCharFormat colorFormat = highlightCursor.charFormat();
13891388

13901389
// clear formatting !
1391-
colorFormat.setFontLetterSpacing(100);
1392-
colorFormat.setForeground(Qt::black);
1393-
colorFormat.setFontWeight(QFont::Thin);
1394-
colorFormat.setBackground(Qt::white);
13951390
highlightCursor.setPosition(document->characterCount() - 1, QTextCursor::KeepAnchor);
1396-
highlightCursor.mergeCharFormat(colorFormat);
1391+
highlightCursor.mergeCharFormat(QTextCharFormat());
13971392
highlightCursor.setPosition(0, QTextCursor::MoveAnchor);
13981393

13991394
if (!searchString.isEmpty())
14001395
{
1396+
QTextCharFormat colorFormat = highlightCursor.charFormat();
1397+
14011398
colorFormat.setFontLetterSpacing(110);
14021399
colorFormat.setForeground(Qt::black);
14031400
colorFormat.setFontWeight(QFont::Bold);
@@ -1600,7 +1597,7 @@ void MainWindow::on_pushButtonSerialConnect_toggled(bool checked)
16001597
parser.restartChartTimer();
16011598

16021599
if (ui->pushButtonLogging->isChecked() && fileLogger.isOpen() == false) // logger on standby ?
1603-
fileLogger.beginLog(ui->lineEditSaveLogPath->text(), ui->checkBoxAutoLogging->isChecked(), ui->lineEditSaveFileName->text());
1600+
fileLogger.beginLog(ui->lineEditSaveLogPath->text(), ui->checkBoxAutoLogging->isChecked(), ui->lineEditSaveFileName->text(), ui->checkBoxTruncateFileOnSave->isChecked());
16041601

16051602
connect(serialStringProcessingTimer, SIGNAL(timeout()), this, SLOT(on_processSerial()));
16061603

@@ -1785,7 +1782,7 @@ void MainWindow::on_pushButtonUDPConnect_toggled(bool checked)
17851782
parser.restartChartTimer();
17861783

17871784
if (ui->pushButtonLogging->isChecked() && fileLogger.isOpen() == false)
1788-
fileLogger.beginLog(ui->lineEditSaveLogPath->text(), ui->checkBoxAutoLogging->isChecked(), ui->lineEditSaveFileName->text());
1785+
fileLogger.beginLog(ui->lineEditSaveLogPath->text(), ui->checkBoxAutoLogging->isChecked(), ui->lineEditSaveFileName->text(), ui->checkBoxTruncateFileOnSave->isChecked());
17891786

17901787
connect(udpStringProcessingTimer, SIGNAL(timeout()), this, SLOT(on_processUDP()));
17911788

@@ -1863,9 +1860,9 @@ void MainWindow::on_pushButtonLogging_toggled(bool checked)
18631860

18641861
if (ui->pushButtonSerialConnect->isChecked() || ui->pushButtonUDPConnect->isChecked())
18651862
{
1866-
if (!fileLogger.beginLog(ui->lineEditSaveLogPath->text(), ui->checkBoxAutoLogging->isChecked(), ui->lineEditSaveFileName->text()))
1863+
if (!fileLogger.beginLog(ui->lineEditSaveLogPath->text(), ui->checkBoxAutoLogging->isChecked(), ui->lineEditSaveFileName->text()), ui->checkBoxTruncateFileOnSave->isChecked())
18671864
{
1868-
addLog("App >>\t logger error - unable to open File",true);
1865+
addLog("App >>\t logger error - unable to open File", true);
18691866
ui->pushButtonLogging->setChecked(false);
18701867
return;
18711868
}

0 commit comments

Comments
 (0)