39 lines
984 B
C++
39 lines
984 B
C++
#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;
|
||
};
|