SDAA259 January 2026 AM623 , AM625 , AM625-Q1 , AM625SIP , AM62P , AM62P-Q1
To connect the slots to the front-end, create an object in the main.cpp file. This object is going to be used in the qml file to call the functions defined in the back-end that was written.
Figure 2-20 Connecting Slots to Your ObjectUse the onClicked() function within the QML file to make the QT application aware that the application must do something when a button is clicked. In this case, call the C++ functions, blink(), on(), and off(), that were defined in the back-end.
Figure 2-21 Calling C++ FunctionsNow when the user runs the application and clicks each of the three buttons in theWindow, the following results are shown in the terminal:
Figure 2-22 Output of Each Function