mirror of
https://github.com/epasveer/seer.git
synced 2026-08-30 17:10:44 +08:00
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#include "SeerSeerLogWidget.h"
|
|
#include "SeerUtl.h"
|
|
#include <QtWidgets/QScrollBar>
|
|
#include <QtCore/QRegExp>
|
|
#include <QtCore/QDebug>
|
|
|
|
SeerSeerLogWidget::SeerSeerLogWidget (QWidget* parent) : SeerLogWidget(parent) {
|
|
}
|
|
|
|
SeerSeerLogWidget::~SeerSeerLogWidget () {
|
|
}
|
|
|
|
void SeerSeerLogWidget::processText (const QString& text) {
|
|
|
|
// Only log '^', '*', and '=' records.
|
|
bool selected = false;
|
|
|
|
if (selected == false && text.front() == '^') {
|
|
selected = true;
|
|
}
|
|
|
|
if (selected == false && text.front() == '*') {
|
|
selected = true;
|
|
}
|
|
|
|
if (selected == false && text.front() == '=') {
|
|
selected = true;
|
|
}
|
|
|
|
if (selected == false && text.contains(QRegExp("^([0-9]+)\\^")) == true) {
|
|
selected = true;
|
|
}
|
|
|
|
if (selected == false && text.contains(QRegExp("^([0-9]+)\\*")) == true) {
|
|
selected = true;
|
|
}
|
|
|
|
if (selected == false && text.contains(QRegExp("^([0-9]+)\\=")) == true) {
|
|
selected = true;
|
|
}
|
|
|
|
if (selected == false) {
|
|
return;
|
|
}
|
|
|
|
// Filter escape characters.
|
|
QString str = Seer::filterEscapes(text);
|
|
|
|
// Write the string to the log.
|
|
textEdit->append(str);
|
|
}
|
|
|