Update Logger for displaying array

This commit is contained in:
QuangNguyenMinh123
2025-11-19 10:25:44 +07:00
parent df35f46c67
commit cb799b7d07
+11 -1
View File
@@ -258,7 +258,17 @@ void SeerVariableLoggerBrowserWidget::handleItemCreate (QTreeWidgetItem* parentI
parentItem->setText(3, id_text);
// Convert to a list of name/value pairs.
QStringList nv_pairs = Seer::parseCommaList(text, '{', '}');
QStringList nv_pairs;
if (text.startsWith("{"))
{
// String might describe an array: {a=1, b=1},{a=1, b=1},{a=1, b=1},{a=1, b=1}
// parentItem->text(0) is timestamp -> parent name should be parentItem->text(1)
nv_pairs = Seer::parseArray(parentItem->text(1), text);
}
else
{
nv_pairs = Seer::parseCommaList(text, '{', '}');
}
// Go through each pair and add the name and its value to the tree.
for (const auto& nv : nv_pairs) {