@Bob64, I changed the placement of the engine.rootContext(...) line, moving it after the initialization of engine. Now, I don't get such errors. I placed it before the
felgo.setMainQmlFileName(QStringLiteral("qml/Main.qml"));line, and it works. The warnings disappear.
I'm left with only one warning now:
Parameter "token" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.
So, I emit the signal from C++ as emit LoginCorrect(token), and I'm trying to catch that in QML by:
function loginCorrectHandler(token) {
console.log("Token:", token)
}
Connections {
target: g_apiManager
onLoginCorrect: {
loginCorrectHandler(token)
}
onLoginFailed: {
console.log("Login failed")
}
}
It's pointing out that I'm using deprecated functions. How should I do it correctly?
//EDIT
That was quite easy, i did it by:
onLoginCorrect: function (token) {
console.log("Token:", token)
}
Correct me if im wrong. Thanks :)