Added system item support, support for RGBControlers with multiple item backends, and item settings widgets
This commit is contained in:
parent
a761eb4317
commit
5fb9ca7cc0
56 changed files with 635 additions and 210 deletions
34
src/items/systemitem.h
Normal file
34
src/items/systemitem.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef SYSTEMITEM_H
|
||||
#define SYSTEMITEM_H
|
||||
|
||||
|
||||
#include "item.h"
|
||||
|
||||
class SystemItem : public Item
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
||||
QString onCommand_;
|
||||
QString offCommand_;
|
||||
|
||||
public:
|
||||
|
||||
virtual void setValue(uint8_t value);
|
||||
|
||||
public:
|
||||
|
||||
SystemItem(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0, QObject *parent = nullptr);
|
||||
SystemItem(const ItemData& itemData, QObject *parent = nullptr);
|
||||
~SystemItem() = default;
|
||||
|
||||
void setOnCommand(const QString& in);
|
||||
void setOffCommand(const QString& in);
|
||||
QString getOnCommand(){return onCommand_;}
|
||||
QString getOffCommand(){return offCommand_;}
|
||||
|
||||
virtual void store(QJsonObject& json);
|
||||
virtual void load(const QJsonObject& json, const bool preserve = false);
|
||||
};
|
||||
|
||||
#endif // SYSTEMITEM_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue