summaryrefslogtreecommitdiffstats
path: root/src/concurrent/doc/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Correct doc snippet licenseLucie Gérard2024-02-281-1/+1
| | | | | | | | | | | | | | All file under doc/snippet should be license as Documentation snippets and according to QUIP-18 [1] this is 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: I76eedfb6b15c4091f726a5652e3530001d7cdaf7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QVariant::value/qvariant_cast: add rvalue optimizationFabian Kosmale2023-06-121-1/+1
| | | | | | | | | | | | | | If we have a rvalue reference to an unshared QVariant, we can avoid potentially expensive copies, and use move semantics instead. [ChangeLog][QtCore][QVariant] Added rvalue QVariant overloads of qvariant_cast<T>() and QVariant::value<T>(). [ChangeLog][Potentially Source-Incompatible Changes][QVariant] It is no longer possible to take the address of a specialization of qvariant_cast; consider using a lambda function instead. Change-Id: Ifc74991eadcc31387b755c45484224a3200bb0ba Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-164-196/+8
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Doc: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-091-1/+1
| | | | | | | | | | Using REQUIRED as a prefix instead of suffix works better with OPTIONAL_COMPONENTS, and is also the order in the CMake manual. Task-number: QTBUG-98867 Pick-to: 6.2 Change-Id: I1ab68408b95d8edf06272a3b9fceccd8d8e597fc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QtConcurrent: fix examples of overloaded methods in docsSona Kurazyan2021-08-182-6/+10
| | | | | | | | | | | | Wrap the overloaded methods in qOverload(), to make the examples compile. Also remove the extra whitespaces when declaring nested templates. Pick-to: 6.1 6.2 Change-Id: If438caa6d705d9036dae45278fb26e080918da89 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update QtConcurrent docs and examples for reductor object usageSona Kurazyan2021-07-262-11/+7
| | | | | | | | | After 6ebe3d0f0806069f906522dfe9b81baa3f3478de users don't have to specify the result type when using functors for as a reductor. Task-number: QTBUG-88448 Change-Id: I065fed11c1a66833ba0aac3d18e7ff0545247be1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Revert "Remove the qmake project files" for snippetsNico Vertriest2021-02-121-0/+3
| | | | | | | | | | | This reverts a limited part of commit ad2da2d27a590333fc89a56fc58700a09c3017b3 that deleted .pro files for snippets compilation. Some .pro files which contain snippets used in the documentation itself should be restored. Task-number: QTBUG-90483 Change-Id: I1b03833c8ff17b5fca43a5b6c5417e8545b1711b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-3/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Document that QtConcurrent::run doesn't support overloaded functionsSona Kurazyan2020-12-231-0/+18
| | | | | | | | | | | | After improving QtConcurrent::run() to use parameter packs for the arguments (see c977e74afd18afff8729070f631e6b7a3f2887f5), calling overloaded functions is ambiguous. Updated the porting guide and the documentation to mention this and describe possible workarounds. Task-number: QTBUG-89648 Pick-to: 6.0 Change-Id: I4c1f996ae67bce8c13cc1f99f54240295db6ae1d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-11-301-1/+1
| | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Pick-to: 6.0 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Prefer versioned CMake library targetsv6.0.0-beta3Kai Koehne2020-11-011-1/+1
| | | | | | | | The non-versioned one's do miss some properties. It's therefore best to not advocate using them. Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtConcurrent: Handle running with promise inside QTaskBuilderJarek Kobus2020-10-281-0/+9
| | | | | | | | | | | Please note, that in case of run with promise it doesn't make sense to provide the overload taking the FutureResult, as if we are going to ignore the returned QFuture object, we can't communicate with the passed QPromise. Fixes: QTBUG-87083 Change-Id: I4066506736c2bbeea3e42030b9495f13e06cb27e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QtConcurrent: Integrate runWithPromise into runJarek Kobus2020-10-281-7/+7
| | | | | | Change-Id: I6eb95aa66ff847e8bb9aac348fded3a5d55015b6 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QtConcurrent: Add documentation for runWithPromise()Jarek Kobus2020-08-261-0/+86
| | | | | | Task-number: QTBUG-84702 Change-Id: Ic8233aeffbdbd1420bdbde7ad7d03f25cd438ea8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix the doc exampleJarek Kobus2020-08-191-1/+1
| | | | | | | | The intention is to return list containing two items, not just one. Change-Id: I96f3ce939f2ef6db6bdac5d9165bb7814ebfa91a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use QList instead of QVector in qtbaseJarek Kobus2020-07-072-16/+16
| | | | | | | | Fixes all other QVector occurrences Task-number: QTBUG-84469 Change-Id: I5f9311298d341a9a3061a6a640539583d1618939 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Document how to use CMake for Qt ConcurrentKai Koehne2020-05-262-0/+7
| | | | | | Task-number: QTBUG-73058 Change-Id: I11398c5837b45ccacb9232609317213133ef20ea Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Improve Map|Map-Reduce and Filter|Filter-Reduce implementationKarsten Heimrich2020-04-142-3/+90
| | | | | | | | | | | | | * support lambda expressions * remove the need to specify result_type * use std::invoke to apply map|filter function * remove usage of FunctionWrapper* and createFunctionWrapper Task-number: QTBUG-33735 Task-number: QTBUG-82646 Change-Id: Ibcbe4278f0742c29182bd506081db0abb516f85f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QTaskBuilder::spawn: add an overload that doesn't return a future objectVitaly Fanaskov2020-04-141-0/+4
| | | | | | Fixes: QTBUG-83175 Change-Id: Idf85e47a2732742884272200d5c753805eaa640b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QtConcurrent: add fluent interface to configure a task before runVitaly Fanaskov2020-03-291-0/+127
| | | | | | | | Task-number: QTBUG-82950 Change-Id: I449da938b6b501a7646b3425edde5c880d6ca87e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
* QtConcurrent::run: accept more then five function's argumentsVitaly Fanaskov2020-03-111-3/+33
| | | | | | | | | | | | | | [ChangeLog][Potentially Source-Incompatible Changes] QtConcurrent::run has the following signatures: run(Function &&f, Args &&...args) and run(QThreadPool *pool, Function &&f, Args &&...args). If f is a member pointer, the first argument of args should be an object for which that member is defined (or a reference, or a pointer to it). See the documentation for more details. Fixes: QTBUG-82383 Change-Id: I18f7fcfb2adbdd9f75b29c346bd3516304e32d31 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Doc: Fix typo and grammar issuesPaul Wicking2018-07-091-9/+9
| | | | | | | | | Fixed typo in code snippet (s/string/strings/). Capitalized start of sentence in comments and added missing dots. Task-number: QTBUG-69331 Change-Id: I397d4f2082c859c014f776ff8e169b6a6cbe4e79 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Doc: Update QtConcurrent::mapped example snippetPaul Wicking2018-04-191-2/+3
| | | | | | | | | | Wrap current example code snippet in std::function as a work-around, as suggested in comment to QTBUG-61145 (see history tab) with the same issue. Task-number: QTBUG-67603 Change-Id: I6875b31d8e983e234b88384c7d76917ac144f953 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix documentation for function objects with map/reduceVille Voutilainen2017-12-082-1/+25
| | | | | | | | | | | | | | The documentation claims that function objects just work with map-reduce. They work for the map function, but not for the reduce function. Making them work for the reduce function was deemed too complex for questionable benefit, so this patch explains the situation and provides a work-around. Task-number: QTBUG-22710 Change-Id: I7f706468e36031bc261234310d331001b96e5137 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Replace std::bind() with lambdas in Qt ConcurrentSze Howe Koh2017-03-073-24/+9
| | | | | | | Lambda functions provide all the benefits of std::bind() plus more Change-Id: Iec30b20bb35ac0fae560435b323f80af2f2e5fce Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: update QtConcurrent snippets to use QRegularExpressionSamuel Gaist2017-02-041-3/+3
| | | | | | | | Update the QtConcurrent code snippets to use the new QRegularExpression class in place of the deprecated QRegExp. Change-Id: I1366f902fc46bbeccc4013dd8adcf5fbfda13aed Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-311-2/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/minimalegl/qminimaleglintegration.cpp Change-Id: Ia6ab42a6daadbf8abc085c971545904d49ea4b56
| * Doc: Fix a typo in QtConcurrent example snippetTopi Reinio2016-10-281-2/+2
| | | | | | | | | | | | | | | | And use different wording to describe QtConcurrent::filtered(), as it doesn't modify the sequence it operates on. Change-Id: I768c0d121e027c5de36ba7bd548c2d4c2a7f1bd9 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| * Added a missing comma to the comment.Jesus Fernandez2016-05-031-1/+1
| | | | | | | | | | Change-Id: Ia32c9b298dc35ccdd95d92550c06cff52f918ea1 Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
* | Unify license header usage.Jani Heikkinen2016-03-293-9/+39
|/ | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-153-9/+9
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-113-15/+15
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QtConcurrent::run: allow to select the thread pool on which to run the taskMarc Mutz2014-08-051-0/+7
| | | | | | | | | | | | This is the second and last part of the forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1281 [ChangeLog][QtConcurrent] run() now optionally takes as its first argument the QThreadPool to run the task on. Task-number: QTBUG-17220 Change-Id: I4b46eca6ef7de9cd34dac07e6d4b8ad830426b97 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Doc: Update boost::bind()/std::tr1::bind() to std::bind()Sze Howe Koh2013-10-283-5/+5
| | | | | | | | | | boost::bind() became part of the C++11 standard with minor modifications. Present the standard version as the main one to use, but list the others as alternatives. Change-Id: If419d8d24c0925119d3b9f7ff76be44981351bc0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-183-3/+3
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move QFutureSynchronizer back to QtCoreMarc Mutz2012-09-281-53/+0
| | | | | | | This class, too, belongs with QFuture. Change-Id: I41a532ca66c156f1631e4b22ffc1a5879c854488 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFutureWatcher back to QtCoreMarc Mutz2012-09-281-50/+0
| | | | | | | | This belongs with QFuture. Change-Id: I555cd01c1d3890fbbaca4fd8a9170292ea4eb0fb Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFuture from QtConcurrent to QtCoreMarc Mutz2012-09-281-64/+0
| | | | | | | | | This class belongs to QThreadPool/QRunnable more than to QtConcurrent, so move to QtCore, where QThreadPool awaits it. Change-Id: Ibf20288a986593bf779453427c2dae8db1e1423a Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtConcurrent::Exception as QException back to QtCoreMarc Mutz2012-09-281-75/+0
| | | | | | | | | Leave the old name as a deprecated typedef; adapt users. This is a prerequisite for moving QFuture back to QtCore. Change-Id: I81dcee2c7e6eb234c16f3f42e2415ca0da3dc4f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-227-42/+42
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Modularize QtConcurrent documentation.Casper van Donderen2012-05-097-0/+695
This change moves the snippets and images to the modularized directories. Change-Id: If52f69c0f8bb4d2df4ee46f5524a82047ec214de Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>