Move to id is size_t

This commit is contained in:
2024-10-10 19:47:18 +02:00
parent d02b31ab25
commit 95a21250a6
27 changed files with 132 additions and 148 deletions
+5 -10
View File
@@ -1,14 +1,14 @@
#include "UI_item.hpp"
UI_item::UI_item(std::string id, std::string type, std::string text, uint8_t text_size, Color fg_color, Color bg_color,
UI_item::UI_item(std::string type, std::string text, uint8_t text_size, Color fg_color, Color bg_color,
QObject *parrent)
: QObject(parrent), m_id(id), m_type(type), m_text(text), m_text_size(text_size), m_fg_color(fg_color),
: QObject(parrent), m_id((size_t)-1), m_type(type), m_text(text), m_text_size(text_size), m_fg_color(fg_color),
m_bg_color(bg_color), enabled(true), visible(true)
{
}
UI_item::UI_item(std::string type, QObject *parrent)
: QObject(parrent), m_id(""), m_type(type), m_text(""), m_text_size(12), m_fg_color(Color::Black),
: QObject(parrent), m_id((size_t)-1), m_type(type), m_text(""), m_text_size(12), m_fg_color(Color::Black),
m_bg_color(Color::White), enabled(true), visible(true)
{
}
@@ -22,11 +22,6 @@ UI_item::~UI_item()
{
}
std::string UI_item::id() const
{
return m_id;
}
std::string UI_item::type() const
{
return m_type;
@@ -142,10 +137,10 @@ void UI_item::from_json(const json &j)
j.at("visible").get_to(visible);
}
json UI_item::to_json() const
json UI_item::to_json(size_t id) const
{
json j;
j["id"] = m_id;
j["id"] = id;
j["type"] = m_type;
j["text"] = m_text;
j["text_size"] = m_text_size;