mirror of
https://github.com/epasveer/seer.git
synced 2026-08-30 00:50:42 +08:00
37 lines
808 B
C++
37 lines
808 B
C++
#include "SeerTildeLogWidget.h"
|
|
#include "SeerUtl.h"
|
|
#include <QtWidgets/QScrollBar>
|
|
|
|
SeerTildeLogWidget::SeerTildeLogWidget (QWidget* parent) : SeerLogWidget(parent) {
|
|
}
|
|
|
|
SeerTildeLogWidget::~SeerTildeLogWidget () {
|
|
}
|
|
|
|
void SeerTildeLogWidget::processText (const QString& text) {
|
|
|
|
if (enableCheckBox->isChecked() == false) {
|
|
return;
|
|
}
|
|
|
|
QString str = text.mid(1); // Remove leading "~"
|
|
|
|
if (str.front() == '"') { // Remove leading """
|
|
str = str.mid(1);
|
|
}
|
|
|
|
if (str.back() == '"') { // Remove trailing """
|
|
str.chop(1);
|
|
}
|
|
|
|
str = Seer::filterEscapes(str);
|
|
|
|
if (str.back() == '\n') { // Remove trailing "\n"
|
|
str.chop(1);
|
|
}
|
|
|
|
textEdit->append(str);
|
|
textEdit->verticalScrollBar()->setValue(textEdit->verticalScrollBar()->maximum());
|
|
}
|
|
|