- Tag-Filter wird gespeichert - Tag Monitor kann bei einem Tag jetzt pro Key mehrere Werte in einer Tabelle anzeigen - Bug für Clear behoben
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
#pragma once
|
|
#include <QWidget>
|
|
#include <QPlainTextEdit>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QLineEdit>
|
|
#include <QPushButton>
|
|
#include <QCheckBox>
|
|
#include <QLabel>
|
|
#include <QSet>
|
|
#include <QRegularExpression>
|
|
|
|
// RawView shows the raw UART output with timestamps, search, tag suppression,
|
|
// unlimited history, H+V scrolling and a copy-to-clipboard button.
|
|
// Auto-scroll is ON by default.
|
|
class RawView : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit RawView(QWidget *parent = nullptr);
|
|
|
|
public slots:
|
|
void appendLine(const QString &line, const QSet<QString> &suppressedTags = {});
|
|
void clear();
|
|
|
|
private slots:
|
|
void onSearch(const QString &text);
|
|
void onScrollValueChanged(int value);
|
|
void onAutoScrollToggled(bool enabled);
|
|
void copyToClipboard();
|
|
|
|
private:
|
|
void setupUi();
|
|
void applyColorScheme();
|
|
|
|
QPlainTextEdit *m_textEdit = nullptr;
|
|
QLineEdit *m_searchEdit = nullptr;
|
|
QPushButton *m_clearBtn = nullptr;
|
|
QPushButton *m_copyBtn = nullptr;
|
|
QCheckBox *m_autoScrollCb = nullptr;
|
|
QLabel *m_lineCountLbl = nullptr;
|
|
bool m_autoScroll = true; // ON by default
|
|
int m_lineCount = 0;
|
|
|
|
static const QRegularExpression s_tagRe;
|
|
};
|