Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to use C++ connect method when qmlRegister is applied?
johnson54 last edited by aha_1980
I'm new to qml, here is my question:
if I have two class, such as class ModelA and class ModelB, they need to communicate
In main.c, I will write as follows:
connect(&m_A, SIGNAL(signalFromA()), &m_B, SLOT(slotFromB());
However, when I bind qml to ModelA and ModelB, in main.c
In this way, there will be no explicit declariton of m_A and m_B, and how can I use the 'connect' method?
when you do qmlregistertype, you are registering the class. So you need to make the connect where you are creating the objects. I'm assuming that you are creating the objects in QML. So you need to make the connect statement in qml code.