Solved Error matching function parameters
-
Hi,
I work on an Qt project created in an old Qt version(4...).
I have a class where is defined signal like this:Q_INVOKABLE void clientsDataComplete(QString serverData, QString testVar, QString test1);
Somewhere in code is emited this signal so:
emit clientsDataComplete("serverResponse", "asdasd", "test1111");
In Qml, where signal is handled, i do this:
onClientsDataComplete: {
console.log("trouble data1: " + serverData);
console.log("trouble data2: " + testVar);
console.log("trouble data3: " + test1);
}And i get this logs:
qml: trouble data1: undefined
qml: trouble data2: serverResponse
qml: trouble data3: asdasdSo, i don't know if it's a bug or wrong coding.
Thanks for any help! -
Hi,
One thing that is out of place is the
Q_INVOKABLE
macro, Signals declaration are enough by themselves. -
This can happen only if the clientsDataComplete is defined with two parameters somewhere and serverData variable is not recognised. Can show you complete class declaration ?
-
Apparently, it seem to be a bug.
https://stackoverflow.com/questions/50817795/qml-c-signal-parameters-undefined-in-qml -
[SOLVED]
An update from Qt 5.11.0 to Qt 5.11.1 solved that issue.