add statusbar
This commit is contained in:
2026-02-14 14:32:09 +01:00
parent e3012d9580
commit 0cdd276194
8 changed files with 90 additions and 2 deletions
@@ -1,4 +1,4 @@
#include "test_sim.hpp"
#include "test.hpp"
EXPORT_SIM(Test_Sim);
@@ -11,7 +11,7 @@ Test_Sim::Test_Sim(Communication *com, QObject *parent)
m_thermo("Thermo", "%", Color::White, Color::Black, 0, 100, 0), m_led("Led", Color::White, Color::Red),
m_table(4, 4, {"Row 1", "Row 2", "Row 3", "Row 4"}, {"Column 1", "Column 2", "Column 3", "Column 4"}),
m_spinbox(0, 255, 0), m_double_spinbox(0, 255, 0), m_hex_spinbox(0, 255, 0),
m_tab_widget({"Tab 1", "Tab 2", "Tab 3"}, 0), m_stacked_widget(3, 0)
m_tab_widget({"Tab 1", "Tab 2", "Tab 3"}, 0), m_stacked_widget(3, 0), m_status_bar()
{
m_thermo.set_start_color(Color::Red);
m_thermo.set_end_color(Color::Red);
@@ -35,6 +35,7 @@ Test_Sim::Test_Sim(Communication *com, QObject *parent)
PUSH_UI_ITEM(m_hex_spinbox);
PUSH_UI_ITEM(m_tab_widget);
PUSH_UI_ITEM(m_stacked_widget);
PUSH_UI_ITEM(m_status_bar);
for (size_t i = 0; i < m_table.capacity(); i++)
{
@@ -90,6 +91,7 @@ void Test_Sim::slider_changed(UI_slider *id, double value)
m_spinbox.set_value(value);
m_double_spinbox.set_value(value);
m_hex_spinbox.set_value(value);
m_status_bar.show_message("Test slider changed to " + std::to_string(value));
return;
}
}
@@ -29,4 +29,5 @@ class Test_Sim : public Simulator_base
UI_hex_spinbox m_hex_spinbox;
UI_tab_widget m_tab_widget;
UI_stacked_widget m_stacked_widget;
UI_status_bar m_status_bar;
};