UvosSmartHomeInterface/src/ui/sensorlistwidget.h

33 lines
722 B
C++

#pragma once
#include <QTableWidget>
#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
bool showHidden_;
public:
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:
void sensorsChanged(std::vector<Sensor> sensors);
};