Skip to content

Conversation

Aminho09
Copy link

Previously, SCTimerService was instantiated using a shared_ptr,
but its constructor only accepted a QObject*. This caused a compilation error due to a
missing matching constructor.

  • Updated sc::qt::SCTimerService to accept shared_ptrsc::qt::TrafficLightStateMachine in its constructor.
  • Ensured proper QObject hierarchy by passing the raw pointer from shared_ptr.
  • Fixed QObject::connect calls by using .get() on shared_ptr.

…fficlight-qt-cpp

Previously, SCTimerService was instantiated using a shared_ptr<TrafficLightStateMachine>,
but its constructor only accepted a QObject*. This caused a compilation error due to a
missing matching constructor.

- Updated SCTimerService to accept shared_ptr<TrafficLightStateMachine> in its constructor.
- Ensured proper QObject hierarchy by passing the raw pointer from shared_ptr.
- Fixed QObject::connect calls by using `.get()` on shared_ptr.
- Prevented potential bad_weak_ptr errors by ensuring TrafficLightStateMachine is managed
  by shared_ptr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant