Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.3, 6.5, 6.6.0 Beta3, 6.6, 6.7.0 FF
-
6.5.2, 6.6
-
None
-
-
9599f4c55 (dev), 5dc4a90e3 (6.5), 5dd59eb4a (6.6)
Description
Since Qt 6.5.2 automatic conversion from JS Array to QByteArray is broken.
Sample code:
QML
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true function testArray(array) { console.log('JS array: ' + array) test.byteArrayTest(array) } Component.onCompleted: { testArray([1, 2, 3]) testArray(Array.from('456')) } }
C++
#pragma once #include <QObject> #include <QDebug> class Test : public QObject { Q_OBJECT public: Q_INVOKABLE void byteArrayTest(const QByteArray &ba) { qDebug() << "QByteArray: " << ba; } };
See full example untitled.zip
To reproduce the problem just compare console output when build with Qt 6.5.2 and Qt 6.5.1 (or any version prior)
Attachments
Issue Links
- is duplicated by
-
QTBUG-116701 ArrayBuffer to QByteArray conversion failes for QT 6.5.2
- Closed