mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
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:
@@ -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;
|
||||
|
||||
@@ -22,6 +22,7 @@ class UI_table : public UI_item
|
||||
std::string column_label(size_t index) const;
|
||||
|
||||
void insert_item(size_t row, size_t column, std::string text);
|
||||
std::string item(size_t row, size_t column) const;
|
||||
|
||||
/**
|
||||
* @brief empty_item This function clears the item and makes it invalid
|
||||
|
||||
Reference in New Issue
Block a user