Pass QByteArray to Qml Text
-
Hi,
In my qt code I emit QByteArray. How properly display my bytes in Text on Qml ?
I try like this :function onSelectId(arrayId) { text1.text = arrayId }
Where arrayId is my QByteArray
But bushes are displayed. -
Hi,
In my qt code I emit QByteArray. How properly display my bytes in Text on Qml ?
I try like this :function onSelectId(arrayId) { text1.text = arrayId }
Where arrayId is my QByteArray
But bushes are displayed.@Damian7546
Do you mean yourQByteArray
contains bytes which are genuine string characters (so could be displayed as-is, just converted to aQString
), or do you mean they are arbitrary bytes and you actually want to display, say, their hex values instead? -
I want to display bytes from this array in hex values for example:
0x05 0x06 0x77 0x44 -
I want to display bytes from this array in hex values for example:
0x05 0x06 0x77 0x44@Damian7546
So if you searched theQByteArray
documentation page forhex
you would hit QByteArray QByteArray::toHex(char separator = '\0') const ! -
It works. Thanks.