[ScenarioComponent] fix Nano inheritance

This commit is contained in:
thibaud keller 2025-01-11 21:13:44 +00:00
parent c1d7604799
commit ab1d9f0594
7 changed files with 10 additions and 9 deletions

@ -1 +1 @@
Subproject commit 9a0bded62d9632d05fac99988a8c53bb5e42b7a4
Subproject commit 995dc6e2b40dae91b0782dba7f9ce712fec10b53

View file

@ -80,8 +80,7 @@ void EventWidget::on_state_added(Scenario::StateModel& state)
void EventWidget::on_state_removed(const Scenario::StateModel& state)
{
if (state.eventId() != model.id())
return;
if (state.eventId() != model.id()) return;
remove_widget([&state]
(const auto& w)

View file

@ -5,7 +5,8 @@
namespace Hardware
{
struct EventWidget final : ScenarioComponentSpec<Scenario::EventModel,
struct EventWidget final : Nano::Observer
, ScenarioComponentSpec<Scenario::EventModel,
bugui::container_widget>
{
explicit EventWidget(Scenario::EventModel& event,

View file

@ -32,7 +32,7 @@ protected:
, skin{Process::Style::instance()}
{ }
ScenarioWidget* scenario;
ScenarioWidget* scenario{nullptr};
const Process::Style& skin;
};

View file

@ -11,6 +11,7 @@ namespace Hardware
class ScenarioWidget final
: public bugui::container_widget
, public QObject
, public Nano::Observer
{
W_OBJECT(ScenarioWidget)
@ -33,7 +34,7 @@ private:
void on_time_sync_added(Scenario::TimeSyncModel& timeSync);
void on_time_sync_removed(const Scenario::TimeSyncModel& timeSync);
Scenario::ProcessModel* model;
Scenario::ProcessModel* model{nullptr};
};
} // namespace Hardware

View file

@ -79,8 +79,7 @@ void TimeSyncWidget::on_event_added(Scenario::EventModel& event)
void TimeSyncWidget::on_event_removed(const Scenario::EventModel& event)
{
if (event.timeSync() != model.id())
return;
if (event.timeSync() != model.id()) return;
remove_widget([&event]
(const auto& w)

View file

@ -6,7 +6,8 @@
namespace Hardware
{
struct TimeSyncWidget final : ScenarioComponentSpec<Scenario::TimeSyncModel,
struct TimeSyncWidget final : Nano::Observer
, ScenarioComponentSpec<Scenario::TimeSyncModel,
bugui::container_widget>
{
explicit TimeSyncWidget(Scenario::TimeSyncModel& timeSync,