Cross-Platform Development with Qt 6 and Modern C++[Book]
Method Three: Tried to set it up so that the QML emits a signal to the C++ object instead of invoking a C++ object slot directly.
Qt 5 C++ – Cơ chế hoạt động của Signal và Slot | Phở Code
Your class must inherit from QObject (through QWidget for example) to be able to use the signal/slot mechanism. ... Linking the signals and slots require to know which object must be linked to which, and which function is linked to which signal.
Signals & Slots | Qt Core | Qt 6.9.1 - doc.qt.io
This is similar to C/C++ function pointers, but the signal/slot system ensures the type-correctness of callback arguments.
