From 034ae1b7f13ae06db411cc42ac2c55158c9128ef Mon Sep 17 00:00:00 2001 From: Alex Spataru Date: Thu, 23 Jun 2022 20:25:10 -0500 Subject: [PATCH] Show group titles in widgets --- src/JSON/Dataset.h | 2 ++ src/UI/Dashboard.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/JSON/Dataset.h b/src/JSON/Dataset.h index 82df1277..e6d06f3d 100644 --- a/src/JSON/Dataset.h +++ b/src/JSON/Dataset.h @@ -89,6 +89,8 @@ public: bool read(const QJsonObject &object); + void setTitle(const QString &title) { m_title = title; } + private: bool m_fft; bool m_led; diff --git a/src/UI/Dashboard.cpp b/src/UI/Dashboard.cpp index a09f9654..620e030c 100644 --- a/src/UI/Dashboard.cpp +++ b/src/UI/Dashboard.cpp @@ -850,7 +850,10 @@ QVector UI::Dashboard::getLEDWidgets() Q_FOREACH (auto dataset, group.datasets()) { if (dataset.led()) + { + dataset.setTitle(dataset.title() + " (" + group.title() + ")"); widgets.append(dataset); + } } } @@ -877,7 +880,10 @@ QVector UI::Dashboard::getFFTWidgets() Q_FOREACH (auto dataset, group.datasets()) { if (dataset.fft()) + { + dataset.setTitle(dataset.title() + " (" + group.title() + ")"); widgets.append(dataset); + } } } @@ -895,7 +901,10 @@ QVector UI::Dashboard::getPlotWidgets() Q_FOREACH (auto dataset, group.datasets()) { if (dataset.graph()) + { + dataset.setTitle(dataset.title() + " (" + group.title() + ")"); widgets.append(dataset); + } } } @@ -930,7 +939,10 @@ QVector UI::Dashboard::getWidgetDatasets(const QString &handle) Q_FOREACH (auto dataset, group.datasets()) { if (dataset.widget() == handle) + { + dataset.setTitle(dataset.title() + " (" + group.title() + ")"); widgets.append(dataset); + } } }