diff options
Diffstat (limited to 'src/corelib/doc/snippets')
| -rw-r--r-- | src/corelib/doc/snippets/code/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp | 21 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/corelib/doc/snippets/code/CMakeLists.txt b/src/corelib/doc/snippets/code/CMakeLists.txt index 402d20cfe7b..e5b65fb3725 100644 --- a/src/corelib/doc/snippets/code/CMakeLists.txt +++ b/src/corelib/doc/snippets/code/CMakeLists.txt @@ -43,7 +43,6 @@ add_library(corelib_snippets_code OBJECT src_corelib_kernel_qmetatype.cpp src_corelib_kernel_qmimedata.cpp src_corelib_kernel_qproperty.cpp - src_corelib_kernel_qsystemsemaphore.cpp src_corelib_kernel_qvariant.cpp src_corelib_mimetype_qmimedatabase.cpp src_corelib_plugin_qlibrary.cpp @@ -115,6 +114,12 @@ if(QT_FEATURE_process) ) endif() +if(NOT EMSCRIPTEN) + target_sources(corelib_snippets_code PRIVATE + src_corelib_kernel_qsystemsemaphore.cpp + ) +endif() + if(QT_FEATURE_widgets) target_link_libraries(corelib_snippets_code PRIVATE Qt::Widgets 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 12e03b01679..71387b1443d 100644 --- a/src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_text_qbytearray.cpp @@ -559,14 +559,17 @@ void wrapInFunction() #include <emscripten/val.h> void emscripten_examples() { - //! [55] - emscripten::val uint8array = emscripten::val::global("g_uint8array"); - QByteArray byteArray = QByteArray::fromEcmaUint8Array(uint8array); - //! [55] - - //! [56] - QByteArray byteArray = "test"; - emscripten::val uint8array = byteArray.toEcmaUint8Array(); - //! [56] + { + //! [55] + emscripten::val uint8array = emscripten::val::global("g_uint8array"); + QByteArray byteArray = QByteArray::fromEcmaUint8Array(uint8array); + //! [55] + } + { + //! [56] + QByteArray byteArray = "test"; + emscripten::val uint8array = byteArray.toEcmaUint8Array(); + //! [56] + } } # endif |
