Qt creator connect slots to signals

broken image

Although I don’t understand why, many projects forbid the use of Qt in the non-GUI parts. Qt developers know that they can break the tight coupling with signals and slots. This couples ClimateModel and ClimateEcuTwin tightly.

broken image

ClimateModel calls setTemperature on a ClimateEcuTwin object directly. I start with the all to normal C++ implementation.

broken image

The ECU produces enough cold air until the target temperature is reached in the car. The HMI application performs the following steps. She decreases the target temperature of the AC to 16 ☌ through the HMI of her car’s infotainment system. Helen drives home in her car after a summer day in the mountains. I invite you to follow along while I translate signals and slots into function-object member variables and lambda functions, respectively. I miss them most when I must write pure C++ code without the Qt goodies. Signals and slots are my favourite Qt feature, as they make loose coupling between components or between layers super easy.

broken image