summaryrefslogtreecommitdiffstats
path: root/examples/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Make Qt Core examples accessible from the TOC treeAlexei Cazacov2025-11-2616-0/+16
| | | | | | Pick-to: 6.10 Change-Id: I16544e9e64f9ef4b43cbd40ad4dd2bc3c30173d4 Reviewed-by: Topi Reinio <topi.reinio@qt.io>
* Doc: Update multi-threading doc titlePaul Wicking2025-09-161-1/+1
| | | | | | | | | | | | Change title from "Thread Support in Qt" to "Multi-threading in Qt" to use more modern and precise terminology. Add target directive to preserve possible existing links and update all cross-references across the codebase. Task-number: QTBUG-140178 Pick-to: 6.10 6.10.0 6.9 6.8 Change-Id: If3457a811d71fa17e29cf5d5886fda11951c2862 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Examples: don't overflow a QRect with adjusted()Thiago Macieira2025-08-271-2/+2
| | | | | | | | | | | | | Required after 1145e1709d1072f7dd45683e9c25a14615603854 made QRect use QCheckedInt. We can avoid this by simply using QRectF one step earlier in the calculation, which a) expands the range from ±2^31 to ±2^53 and b) neatly avoids infinite zooming by not doing anything after 2^53 (because 2^53 + 1 = 2^53). Fixes: QTBUG-138504 Pick-to: 6.10 Change-Id: Ibe382ad9b98bbfb9fde6fffd94bd733a4b999852 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Compile androidnotifier only if widgets are availableJuha Vuolle2025-05-021-1/+1
| | | | | | | | | | The example links against widgets => add proper build-time guard. Task-number: QTBUG-136101 Pick-to: 6.9 6.8 Change-Id: I9e279791de5adf4e8bc86a09cb11e96022f9e1ce Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Compile calendarbackendplugin only if widgets are enabledJuha Vuolle2025-04-292-2/+4
| | | | | | | | | | | The example links against widgets unconditionally => add proper build-time guard Task-number: QTBUG-136101 Pick-to: 6.9 Change-Id: I62ea42a04f7ff421753a0fc7a30cd969cfaff6e2 Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Examples: fix a couple of nodiscard warnings from QFile::openGiuseppe D'Angelo2025-04-241-3/+5
| | | | | | | | | | In one case, the code simply checked for isOpen afterwards; refactor it to use QFile::open's result. In another case, a file was opened from the resource system, so add a check. Pick-to: 6.9 6.8 Change-Id: I5f4c22dd5ce678f15c9c1609c4228d50a2b32a1d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Examples: fix UB calls into QElapsedTimerGiuseppe D'Angelo2025-03-261-1/+1
| | | | | | | | | Calling restart() without start() is illegal, so don't do that; use start() instead. Pick-to: 6.9 6.8 6.5 Change-Id: I2ff5151f588cb926ccecc3d9997615e63f36ee24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Docs: Create \Q4A macro for "Qt for Android" and replace instancesNicholas Bennett2025-02-281-2/+2
| | | | | | | | | | | | | | "Android" is trademarked and needs to be referenced in a certain way. The following steps were taken: -Created qdoc macro. -Updated "Qt Android" and "Qt for Android" to use \Q4A in qdoc files. The macro will need to be adopted in all documentation projects. Task-number: QAA-2836 Pick-to: 6.9 6.8 6.5 Change-Id: I4b52247a4ed52047242a06404e6d3aa19de9c16c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Fix examples built as external projectsJoerg Bornemann2025-01-272-2/+2
| | | | | | | | | Usage of a private module needs a respective find_package call now. Pick-to: 6.9 Task-number: QTBUG-87776 Change-Id: I3a00a241c5e8637d28606c1f45a843b491c0a8bc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace qdebug.h includes in public headers with forward-declarationsAhmad Samir2025-01-151-0/+1
| | | | | | | | | | | | | | | | | | | qdebug.h includes many Qt and STL headers, so if you include a Qt header you get all those transitive includes, which may affect build time. - Where appropriate use the printf-like syntax of qDebug() and co., these don't need the QDebug streaming operators - qfloat16 is used in an inline member function, so include it explicitly [ChangeLog][Potentially Source Incompatible Changes] Various Qt public headers don't include QDebug any more; if you need QDebug's streaming you'll have to include it in your code. Task-number: QTBUG-132439 Pick-to: 6.9 Change-Id: I750587e17a3b38fa226cd3af8eaccc8da580f436 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mime type browser example: Add translator loader codeFriedemann Kleint2025-01-061-0/+16
| | | | | | | | | Enable testing translations. Task-number: QTBUG-127004 Pick-to: 6.9 6.8 Change-Id: Ie83092b4db5bcf516834cf0b5b564a67d7ab6227 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Remove usage of defunct QDoc commandPaul Wicking2024-08-281-4/+0
| | | | | | | | | | | | | | The QDoc command `\tableofcontents` was rendered useless by a change more than a decade ago. Remove the use of `\tableofcontents` as it serves no purpose, and ensure that the surrounding context still makes sense for the reader, by removing preceding text that refers to a non-existing table of contents, such as `Contents:`. Task-number: QTBUG-128173 Pick-to: 6.8 Change-Id: Ibb5a6af0e80f70fa487cdf6a7e38009a9ef60cbf Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* CMake: Fix project structure of calendarbackendplugin projectAlexandru Croitor2024-07-304-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, installing the example with a multi-config generator failed with CMake Error at cmake_install.cmake:123 (include): include could not find requested file: <build_dir>/.qt/deploy_calendarPlugin_49e753a159-$<CONFIG>.cmake When configuring the project, cmake mentions the following warning: CMake Warning (dev) in CMakeLists.txt: Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator expressions. Run "cmake --help-policy CMP0087" for policy details. This happens because the specified minimum cmake version of the project was 3.5, so the above policy was not enabled, and the generator expressions we use for the deployment api failed to be evaluated. Fix the minimum version to be 3.16. Clean up the project a bit to be in line with our other examples. Use qt_internal_add_example, remove redundant find_package(Qt) calls, remove redundant project() and cmake_minimum_required() calls, use target_include_directories. Amends f071d4ee8abf6fd0f1b6e187b4e99fa6fad7b642 Fixes: QTBUG-127616 Task-number: QTBUG-115200 Change-Id: I06ca1d38a8e5e7cb18ade205616a603db98a17be Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QCalendar example illustrating the user-supplied plugin mechanismMagdalena Stojek2024-07-0418-1/+580
| | | | | | | | | This example demonstrates how to write a calendar backend plugin using a low-level API for extending Qt applications. Fixes: QTBUG-115200 Change-Id: If0b7f2552ba8c2203acdcbff238fb0ffa7cfca55 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Android: cleanup AndroidManifest.xml files in examplesAssam Boudjelthia2024-05-231-5/+0
| | | | | Change-Id: I6b0a11ace348891da7ed16dd9039b807902cb828 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Remove check for Qt version > 4 that's not useful nowAssam Boudjelthia2024-04-241-2/+1
| | | | | | Pick-to: 6.7 Change-Id: Ia24b2b9fb9f3b070f8eccaf74a09787b324ab01e Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Fix feature dependencies for sharedmemoryMorten Sørvig2024-04-171-1/+1
| | | | | | | | | The sharedmemory example depends on systemsemaphore as well. Change-Id: I0937e6429589f715ec446ac1337e21cb23cdf92b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
* Android notification example: Correct connect statementsAxel Spoerl2024-04-041-2/+2
| | | | | | | | | | | | The example breaks building 6.7 with examples on Android, due to QObject::connect() to a lambda without context object. Add context object. Fixes: QTBUG-123989 Pick-to: 6.7 6.6 6.5 6.2 Change-Id: Id3994e577a8a676220ac8d9f95d01c054839c143 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: add core-private to use private permissions APIAssam Boudjelthia2024-03-251-0/+1
| | | | | | | | | Amends 7fa6d09ca20b27b8350e6e26040372ba70e6244d. Pick-to: 6.7 6.7.0 6.6 6.5 Fixes: QTBUG-123353 Change-Id: If79498d28b890772f23963621e6e7bd263a56aca Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-2215-135/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects were modified using the tool at: https://git.qt.io/alcroito/cmake_refactor A couple of examples had to be adapted manually, due to them including more than one app per example subdirectory. The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were removed. The install(TARGETS) calls were modified according to our documentation snippets for qt_generate_deploy_app_script. A qt_generate_deploy_app_script call was added for each executable target. Note that the deployment step will be skipped in the CI for now, because we enable QT_DEPLOY_MINIMAL_EXAMPLES and thus QT_INTERNAL_SKIP_DEPLOYMENT, and also because standalone examples are not enabled yet, and deployment is disabled for in-tree (so no-standalone-example) prefix builds. The install(TARGETS) calls for each example will still run, installing the examples into an installed_examples directory, that will not be archived by the CI. Pick-to: 6.7 Task-number: QTBUG-102056 Task-number: QTBUG-102057 Change-Id: Ida389bbad41710b2ae5da4d95e2d85be9e0cd9ce Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Use qt_internal_add_example for bindablepropertiesAlexandru Croitor2024-03-111-1/+1
| | | | | | | | | | | bindableproperties is the actual project, not a subdirectory with separate examples. It should use qt_internal_add_example. Pick-to: 6.6 6.7 Task-number: QTBUG-90820 Task-number: QTBUG-123096 Change-Id: I409d20e035956e6c236f84721b3c6882893cd547 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Correct license for examples filesLucie Gérard2024-03-0725-25/+25
| | | | | | | | | | | | | | Example takes precedent over build system file type. According to QUIP-18 [1], all examples file should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Id348a89884bb309b96abb31077f14a51086b5d0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Assign a category to Contiguous Cache ExampleKai Köhne2024-02-191-0/+1
| | | | | | Pick-to: 6.6 6.7 Change-Id: I98e62adce63df7e940d96cd50dcb243366dca216 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Android: request POST_NOTIFICATIONS permission for Android NotifierAssam Boudjelthia2024-02-063-0/+14
| | | | | | | | | | Android 13 and above requires the notification permission "android.permission.POST_NOTIFICATIONS" to be requested at runtime. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-121668 Change-Id: I38512ffc07c1a3ffe7cddffa937b98332f172d15 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: fix style extraction when set to noneAssam Boudjelthia2024-02-061-4/+0
| | | | | | | | | | | If extract_android_style meta data is set to none currently the app still tries to extract full stlye and crashes. If this option is set no style data should be extracted after this patch. Pick-to: 6.7 Fixes: QTBUG-121667 Change-Id: I764e1eb6a582073196f991ca930d245d17a1f7e5 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: remove redundant comments from notifier example manifestAssam Boudjelthia2023-12-221-5/+1
| | | | | | | Task-number: QTBUG-115020 Pick-to: 6.7 Change-Id: I29cd7a45f85bc85f6f12b135287b9eb868a7bc44 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Doc: Fix documentation issues for Qt CoreTopi Reinio2023-12-192-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix template arguments in \fn signatures for Qt::compareThreeWay() functions. * Fix template arguments in \fn signatures for QDebug::operator<<() functions. * Fix \sa links to specific overloads of QSpan functions. * Fix \sa links to specific overloads of QFileInfo::fileTime(). * Remove references to 'Custom Type Example' (example has been removed). * Fix linking to 'JSON Save Game' example. * Fix references to 'Queued Custom Type' example. * Fix linking to QCryptographicHash::Algorithm. * Fix linking to Qt Qml module. * Fix undocumented parameters in qHypot(). Pick-to: 6.7 Change-Id: If9eb9978a14e147f003672a682972b319454c311 Reviewed-by: Luca Di Sera <luca.disera@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* examples: update local fortune example to use transactionSamuel Gaist2023-12-042-12/+5
| | | | | | | | | | The local version of the fortune server and clients were not using the transaction paradigm yet. This patches fixes it and makes the example in line with the network version. Pick-to: 6.6 6.5 Change-Id: Ieb68f67e2921f46acd682f81dfa5dc5b040c88f5 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Rework documentation of the serialization converter exampleEdward Welbourne2023-11-015-59/+140
| | | | | | | | | | | | | | | | | | | The documentation was previously code-heavy and short on exposition, while focusing almost entirely on the CBOR converters. Prune most of the CBOR code quotes, shuffle some snippet markers, add and remove others and rewrite the main text. Shift focus to the base-class for converters and how it's used by main(). Retain relative focus on the CBOR converters, as they are relatively full-featured hence illustrate more than the others do, and replace the sequence of single-line sections about the others with a section collecting all into a table and saying some general things about them. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I8d41f25c165eb1a7ba20cb68aee6ab6b2fd050f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Eliminate duplicate overrides of Converter methods in exampleEdward Welbourne2023-11-0112-82/+21
| | | | | | | | | | | | | | | | | The Out-only converters shouldn't need to implement loadFile(), as it shouldn't be called - a converter is not used for input unless it says it supports input. At the same time, provide the "ground state" implementations for optionsHelp(), outputOptions() and probeFile() to save the trivial implementations the need to duplicate one another. In the process, make the handling of loadFile()'s outputConverter more consistent among those that do implement it. Always set outputConverter if it's initially null (the caller does assert this). Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I856d12c791d1f8e0accdb7dd1412d493117b2302 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Converter class, in eponymous example, to a file of its ownEdward Welbourne2023-11-014-22/+27
| | | | | | | | | | There's more details coming and it's good hygiene anyway. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Ief3acf6e508bc93eaa8490f6c49300b25c1d3556 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Break out the list of available converters to a static methodEdward Welbourne2023-11-012-10/+20
| | | | | | | | | | | | | Mostly to pave the way for moving the class code to a file of its own, but this incidentally saves the need to std::as_const() every use. Moving the underlying object to a local static of a private method also saves the need for heap allocation (which was leaked). Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I30f4bf3c46d39e04d0ac4e3e9ba431945ebb9193 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Replace confusing member variable with a predicateEdward Welbourne2023-11-014-4/+7
| | | | | | | | | | | | | | | | | | | The Converter class, in the eponymous example, had a null member variable that wasn't a nullptr - it pointed to an instance of NullConverter - so that other converters could test whether a Converter * they'd been passed was null (in the sense of pointing to a NullConverter). This, however, was susceptible to misreading - I misread one such comparison as a nullptr check and thus thought it redundant with an earlier actual nullptr check. To spare future readers similar confusion, replace the public static member variable with a protected (since only other derived classes need it) static predicate, to at least give the reader a clue that this is using the word null in a class-specific sense. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I1e4f494b303d1bf90107f8c6fa3a4a22f6d81b90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename Convert Example to Serialization ConverterEdward Welbourne2023-10-302-4/+4
| | | | | | | | | | | | The old name didn't say what sort of thing it was converting; and our guidelines for examples discourage using the word Example in the title. Also reword the description of the tool in the command-line parser and an assertion. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I6f52f5227362b4b807c8aabfd2103287af42bca0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Convert fprintf(stderr, ...); exit(EXIT_FAILURE); to qFatal(...)Edward Welbourne2023-10-307-91/+62
| | | | | | | | | | | | The serialization conversion example used raw C's way to abort on error; change to using Qt's way of doing the same. Likewise, convert the various other uses of fprintf(stderr, ...) to qWarning() and of printf(...) to qInfo(). Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Ia8821d3c20f58f71c106028ec422ad473c11e164 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Make Converter::saveFile() consistently error on unexpected optionsEdward Welbourne2023-10-301-1/+4
| | | | | | | | | | Have the text dumper do the same as all the others, instead of ignoring unknown options. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I3c1dcbeda19e679be562110e44c5f566dfcc79ce Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QueuedCustomType example: use QThread::requestInterruptionVolker Hilsheimer2023-10-273-19/+2
| | | | | | | | | | | | | Drop the home-made solution with mutex and bool (which could have been an atomic, but we have had a ready-made solution in QThread for a long time). Pick-to: 6.5 6.6 Change-Id: Id213a021f0ae94215afb28ff874fcb597dd1e6f9 Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Ed Cooke
* Rename the JSON Save Game Example to Saving a Game to FileEdward Welbourne2023-10-201-1/+1
| | | | | | | | | | | Partly because it also saves to CBOR, but also because our guidelines say to avoid using "Example" in the title. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Id858475a6b0474228cfe8044e188cc763f56e3a8 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Split VariantOrderedMap out of Converter's header in exampleEdward Welbourne2023-10-168-15/+31
| | | | | | | | | | Although used mostly in the same files, they're separate types, so define them in separate places. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I9e64b382ad48f9a74e432ccd49b6f5fcc9316da3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Remove unused Map alias for VariantOrderedMap in convert exampleEdward Welbourne2023-10-161-2/+0
| | | | | | | Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Ic82f7961df5f7a5bb0cd6cc113e4019508e58f47 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Local Fortune Server Example: Allow specifying the server nameRym Bouabid2023-10-063-21/+77
| | | | | | | | | | | | The server used to hardcode the name while the client allows the user to specify it. The server's UI is adjusted to let the user first specify the server name he wants to listen to and second stop listening to the current server. Task-number: QTBUG-117064 Pick-to: 6.6 6.5 Change-Id: I80fc976151ead7a181fbc32080597277bc515313 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Bindable Properties exp: Revisit documentationRym Bouabid2023-10-051-1/+2
| | | | | | | | | | Remove "Example" from the title. Add \examplecategory Data Processing & I/O Fixes: QTBUG-114689 Pick-to: 6.6 6.5 Change-Id: I695df195819cc371d404c4c5f01a0c4830d9c438 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Shared Memory example: Add \examplecategory Data Processing & I/ORym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108858 Pick-to: 6.6 6.5 Change-Id: I66e1f92eb25ec1377c1f927e767cebaeb3ef5fec Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Wait conditions exp: Add \examplecategory Data Processing & I/ORym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108860 Pick-to: 6.6 6.5 Change-Id: I2ccf20f42d5abaa22e2daf4c8e7777ff903d947e Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Semaphores example: Add \examplecategory {Data Processing & I/O}Rym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108859 Pick-to: 6.6 6.5 Change-Id: I0fecf50e95c351564e7e41142cd3d385c4d1d867 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Mandelbrot example: Add \examplecategory {Data Processing & I/O}Rym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108861 Pick-to: 6.6 6.5 Change-Id: Ie622a94072e243eb5d3f6c162e490884d4cdd0f2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Remove Custom Type Example and Custom Type Sending ExampleRym Bouabid2023-10-0415-484/+1
| | | | | | | | | | | | | | | | | | | | | The whole Q_DECLARE_METATYPE part is superfluous in these two examples, as QVariant works with any type as long as it is copy-constructible. And QVariant will call the equivalent of qRegisterMetaType, so that doesn't need to happen, either. Showing how to integrate the type with qDebug is fine in theory, but also a repetition of content that can be found in other places. Given that there isn't much else being shown in these two examples, it's better to remove them from examples and move them to manual tests. Some parts of "Custom Type Example" were used as snippets in other documentations under qtbase/src/corelib. So, they were added in customtypeexample.cpp file in the snippets folder. Fixes: QTBUG-117001 Pick-to: 6.6 6.5 Change-Id: I45b16338912e3f7394cbb5169642bd31af32d5e1 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Doc: QtCore: Fix documentation issuesTopi Reinio2023-10-023-3/+3
| | | | | | | | | | | | | | | * Fix references to Wait Conditions Example, Semaphores Example, and MIME Type Browser Example as they were renamed. * Rename 'Shared Memory' example as its title clashes with the title of another page (sharedmemory.html). src/corelib/global/qfloat16.cpp: * warning: Invalid '\relates' (already a member of 'qfloat16') Pick-to: 6.5 6.6 Change-Id: Ia28be8e3882a7ad1fadcdbd50a657705d58526bd Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Revamp Queued Custom Type Ex: Revisit the documentationRym Bouabid2023-10-022-3/+3
| | | | | | | | | | Remove "Example" from the title. Add \examplecategory {Data Processing & I/O}. Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: Ieaab75dedb60329dcdcbbcfe6e2ad360df4d98df Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revamp Queued Custom Type Ex: Declare stopProcess() as a methodRym Bouabid2023-10-021-3/+1
| | | | | | | | | | | Declare stopProcess() as a method because it's used in the connect() overload taking a pointer-to-member-function, so it doesn't need help from moc. Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: Iaa1c02de82cffdea455af520c37dc0e6e6861443 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>