Add group field to items

This commit is contained in:
Carl Philipp Klemm 2026-04-01 18:06:11 +02:00
parent 9648c7c040
commit 0e09b6f46c
2 changed files with 21 additions and 4 deletions

View file

@ -32,6 +32,7 @@ protected:
bool loaded_;
bool hidden_;
item_value_type_t type_;
QString groupName_;
public:
ItemData(uint32_t itemIdIn = QRandomGenerator::global()->generate(),
@ -39,7 +40,8 @@ public:
uint8_t value = 0,
bool loaded = false,
bool hidden = false,
item_value_type_t type = ITEM_VALUE_BOOL);
item_value_type_t type = ITEM_VALUE_BOOL,
QString groupName = "All");
inline bool operator==(const ItemData& in) const
{
@ -61,6 +63,8 @@ public:
bool isHidden() const;
void setHidden(bool hidden);
item_value_type_t getValueType();
QString getGroupName() const;
void setGroupName(QString groupName);
virtual QString getName() const;
virtual void store(QJsonObject& json);
virtual void load(const QJsonObject& json, const bool preserve = false);