I’m currently porting a C++ application to Felgo. One problem I’m facing is the communication between C++ and QML, because it just won’t work. I’ve read all of the official tutorials and other examples there is.
main.cpp
... qmlRegisterType<tile>("io.qt.examples.tile", 1, 0, "Tile"); QQmlContext *context = engine.rootContext(); tile t; context->setContextProperty(QStringLiteral("tile"), &t); ...
tile.h
public:
…
signals:
void tileChanged(QString number, QString name, QString color, QString status);
tile.cpp
...
emit tileChanged();
...
page.qml
import io.qt.examples.tile 1.0
Page {
…
Connections{
target: tile
onTileChanged: { console.log(“HELLO WORLD!”) }
}
Tile{
onTileChanged: { console.log(“HELLO WORLD!”) }
}
…
}
But nothing seems to be on the console. And yes, the function is emitted properly – I checked it with the debugger. Any help would be appreciated.