If I have a
signal:
void foo(QByteArray data);
And in QML I handle it:
onFoo: {
console.log(data.toString());
}
What is the type of data in QML? What methods does it have? It doesn't seem to be a javascript string - it doesn't even have a .length
, and no .charCodeAt()
. But it also doesn't seem to be a QByteArray
- no .at()
. data[0]
is undefined
! It does have .toString()
.
How do I access its contents? E.g. if it is a four-byte uint32_t, how do I get that number into a javascript variable?