Tests for UI tabe

Adds functionality to retrieve an item from the UI table.
Also adds tests for the UI table functionality, including
serialization, label setting, item insertion, and item clearing.
This commit is contained in:
2026-02-14 14:32:30 +01:00
parent c6e56aea4a
commit e5fefa57ac
3 changed files with 73 additions and 0 deletions
+11
View File
@@ -120,6 +120,17 @@ void UI_table::insert_item(size_t row, size_t column, std::string text)
emit ui_changed();
}
std::string UI_table::item(size_t row, size_t column) const
{
if (m_column_count <= column || m_row_count <= row)
{
return "";
}
size_t index = row * m_column_count + column;
return m_table.at(index);
}
void UI_table::empty_item(size_t row, size_t column)
{
size_t index = row * m_column_count + column;