Fix incorrect sensor selection due to reorder sensors in SensorListWidget

This commit is contained in:
Carl Philipp Klemm 2025-10-05 23:29:23 +02:00
parent 271330d5fd
commit 0c5603ca44
7 changed files with 47 additions and 15 deletions

View file

@ -3,6 +3,15 @@
#include <vector>
#include "../sensors/sensor.h"
class SensorListItem : public QTableWidgetItem
{
Sensor sensor;
public:
const Sensor& getSensor();
SensorListItem(const QString& text, const Sensor& sensor);
};
class SensorListWidget : public QTableWidget
{
Q_OBJECT
@ -11,10 +20,11 @@ class SensorListWidget : public QTableWidget
public:
SensorListWidget(const bool showHidden = true, QWidget *parent = nullptr);
SensorListWidget(const bool showHidden = true, QWidget* parent = nullptr);
SensorListWidget(SensorStore& sensorStore, const bool showHidden = true, QWidget* parent = nullptr);
virtual ~SensorListWidget() {}
void setShowHidden(const bool showHidden);
const Sensor& getSensorForIndex(const QModelIndex &index);
public slots: