diff options
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp index 8a9cb7c841..2a780f1c49 100644 --- a/src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp @@ -461,4 +461,15 @@ QByteArray ba = QByteArrayLiteral("byte array contents"); QByteArray encoded("Qt%20is%20great%33"); QByteArray decoded = encoded.percentDecoded(); // Set to "Qt is great!" //! [54] + +//! [55] +emscripten::val uint8array = emscripten::val::global("g_uint8array"); +QByteArray byteArray = QByteArray::fromUint8Array(uint8array); +//! [55] + +//! [56] +QByteArray byteArray = "test"; +emscripten::val uint8array = QByteArray::toUint8Array(byteArray); +//! [56] + } |