What does QByteArray get converted to in QML?
As stated in here :
The QML engine provides automatic type conversion between QByteArray values and JavaScript ArrayBuffer objects.
This feature is available since Qt 5.8.
According to http://doc.qt.io/qt-5/qtqml-cppintegration-data.html and the current source http://code.woboq.org/qt5/qtdeclarative/src/qml/compiler/qqmltypecompiler.cpp.html#567, there's no conversion between QByteArray towards QML. You'll probably get an opaque, unaccesible Object in JS.
EDIT: The above was true up to Qt 5.8. 5.8 added a conversion between QByteArray and JS Array, see the other answer.
Needless to say: at the time of this writing, the only version you want to be using is >= 5.12.