Files
uartscope/include/tagpanel.h
2026-06-09 09:04:59 +02:00

39 lines
984 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <QGroupBox>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QTableWidget>
#include <QStringList>
// TagPanel displays the most recent data for a single tag (e.g. [WDG]).
// Key=value pairs are shown in a table that updates in-place.
// A "Copy" button copies the current values to the clipboard.
// No timestamp is shown here timestamps belong in the Raw view.
class TagPanel : public QGroupBox
{
Q_OBJECT
public:
explicit TagPanel(const QString &tag, QWidget *parent = nullptr);
const QString &tag() const { return m_tag; }
public slots:
void update(const QString &value);
private slots:
void copyToClipboard();
private:
void parseKeyValue(const QString &value);
void showRaw(const QString &value);
void ensureRow(const QString &key);
QString m_tag;
QTableWidget *m_table = nullptr;
QLabel *m_rawLabel = nullptr;
QStringList m_keys;
};