Add unit support to sensors

This commit is contained in:
Carl Philipp Klemm 2026-03-29 22:11:10 +02:00
parent 3e0ba165e8
commit 37c0c5d17b
12 changed files with 73 additions and 41 deletions

View file

@ -94,7 +94,7 @@
</property>
<property name="minimumSize">
<size>
<width>300</width>
<width>400</width>
<height>0</height>
</size>
</property>

View file

@ -55,6 +55,11 @@ void SensorListWidget::sensorsChanged(std::vector<Sensor> sensors)
itemString.append("\"Playing\"");
else itemString.append("\"Silent\"");
}
else if(!sensors[i].getUnit().isEmpty())
{
itemString.append(" ");
itemString.append(sensors[i].getUnit());
}
setItem(static_cast<int>(row), 0, new SensorListItem(sensors[i].name + (sensors[i].hidden ? " (H)" : ""), sensors[i]));
setItem(static_cast<int>(row), 1, new QTableWidgetItem(itemString));