summaryrefslogtreecommitdiffstats
path: root/src/concurrent
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix QtConcurrent::run member function parameter order documentationDheerendra Purohit2025-06-131-4/+5
| | | | | | | | | | | Updated the description to match Qt 6 behavior, clarifying that the instance argument now follows the member function pointer. Fixes: QTBUG-113401 Pick-to: 6.10 6.9 6.8 Change-Id: I6cb9c63718790eda153bc5202ed4eb1d23f032bc Reviewed-by: Axel Spoerl <[email protected]>
* QtConcurrent: mark as security-significantIvan Solovev2025-05-2821-0/+21
| | | | | | | | | | | | | | | | | The QtConcurrent module applies user-provided map-, filter-, and reduce- functions (or their combinations) to user-provided data. It does not make any assumptions about the provided functions and data, apart from input/return type validation. It also does not parse the provided data and does not have any way to sanitize it. Mark all the source and header files in the module with the default security-significant score to confirm that the code was reviewed. QUIP: 23 Fixes: QTBUG-135179 Pick-to: 6.9 6.8 Change-Id: I2c1b315b837111627c2f0ce6e2ade704415972e2 Reviewed-by: Edward Welbourne <[email protected]>
* Doc: Enable automatic linking to sources on code.qt.ioTopi Reinio2025-05-271-0/+3
| | | | | | | | | | | | Since 6.10, QDoc is capable of generating links to the declaration in the source code for each documented C++ API entity in their `Detailed description`. Add the required configuration to enable this feature in online documentation builds. Change-Id: Iaafabc5aea50a6cd72549bb1c04007bb4de498ca Reviewed-by: Paul Wicking <[email protected]>
* docs: Clarify adding a continuation to a QFuture with multiple resultsIvan Solovev2025-03-244-0/+62
| | | | | | | | | | | | | Explain that the continuation should take QFuture<T> as a parameter in order to be able to access all results. Add notes with examples to the QtConcurrent::mapped and QtConcurrent::filtered overviews. Task-number: QTBUG-133522 Pick-to: 6.9 6.8 6.5 Change-Id: I65655aadc8d4623b147d22a9bf9b2189c80b14c5 Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* CMake: Prevent creation of private modules without private headersJoerg Bornemann2025-03-131-2/+1
| | | | | | | | | QtConcurrent and QtOpenGLWidgets don't have any private headers. There's no point in creating private modules for them. Task-number: QTBUG-132526 Change-Id: I2a19ae13d11232b47fd72e46173e8d8cb34a4189 Reviewed-by: Alexey Edelev <[email protected]>
* Qt Concurrent documentation: fix Forward Iterator example containerAurélien Brooke2025-02-131-1/+1
| | | | | | | | | std::slist doesn't seem to even exist on Google, while std::forward_list exists in the standard since C++11. Pick-to: 6.8 6.9 Change-Id: I9869c716fb631bc743e656a3b8bbb8ca35c9a1ed Reviewed-by: Ivan Solovev <[email protected]>
* Remove unused qdebug.h includesAhmad Samir2025-01-131-1/+0
| | | | | | | Pick-to: 6.9 Change-Id: I09ad5987bde71ca37c7869c4dd63fb4f41c707ea Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* QtConcurrent: fix support for callables with deduced return typeIvan Solovev2025-01-061-3/+3
| | | | | | | | | | | | | | | | | | | Commit 6ebe3d0f0806069f906522dfe9b81baa3f3478de introduced extra SFINAE checks on the template conditions. However, it broke the case of using callables with deduced return type, because SFINAE does not work for such conditions and treated as a hard error instead. Fix by explicitly providing all template parameters, so that compiler could figure a better overload on its own. Only QtConcurrent::blockingMapped() seems to be affected, but add unit-tests to check all other methods as well. Fixes: QTBUG-130766 Pick-to: 6.9 6.8 6.5 Change-Id: I1ddbe712d8ce04ac96ba13841cb569d728cfb943 Reviewed-by: Tatiana Borisova <[email protected]>
* Docs: Organize topics in the qtbase repoAlexei Cazacov2024-08-132-1/+29
| | | | | | | | | | This commit organizes the articles, so they: - have a reasonable tree structure - can be navigated through the topic tree in the Qt Creator help viewer Task-number: QTBUG-127046 Change-Id: I66f2b131b8aacc887b35a770e51c1425431dffb5 Reviewed-by: Topi Reiniö <[email protected]>
* Remove GENERATE_CPP_EXPORTS argumentAlexey Edelev2024-06-121-1/+0
| | | | | | | | | The behavior that argument was enabling is the default one now. Pick-to: 6.8 Task-number: QTBUG-90492 Change-Id: I11711d4c794f0b22169abb595b8ffad2eeb1300d Reviewed-by: Alexandru Croitor <[email protected]>
* Long live [[nodiscard]] QFile::openGiuseppe D'Angelo2024-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having already caught some bugs in real code because of unchecked calls to QFile::open, this commit marks QFile::open (and open() in other file-I/O classes) as [[nodiscard]]. Since it's going to raise warnings, the plan is to keep the existing behavior up to and including the next LTS. Then the warnings will switch on by default. All of this is protected by system of macros to opt-in or opt-out the behavioral change at any time. A possible counter-argument for doing this is that QFile::open is also used for opening files in the the resource system, and that opening "cannot fail". It clearly can, if the resource is moved away or renamed; code should at a minimum use a Q_ASSERT in debug builds. Another counter-argument is the opening of file handles or descriptors; but again, that opening may fail in case the handle has been closed or if the flags are incompatible. --- Why not marking *every* open() override? Because some are not meant to be called directly -- for instance sockets are supposed to be open via calls to `connectToHost` or similar. One notable exception is QIODevice::open() itself. Although rarely called directly by user code (which just calls open() on a specific subclass, which likely has an override), it may be called: 1) By code that just takes a `QIODevice *` and does something with it. That code is arguably more rare than code using QFile directly. Still, being "generic" code, they have an extra responsibility when making sure to handle a possible opening failure. 2) By QIODevice subclasses, which are even more rare. However, they usually ignore the return from QIODevice::open() as it's unconditionally true. (QIODevice::open() doesn't use the protected virtual pattern.) I'll try and tackle QIODevice in a future commit. [ChangeLog][QtCore][QFileDevice] The open() functions of file-related I/O classes (such as QFile, QSaveFile, QTemporaryFile) can now be marked with the "nodiscard" attribute, in order to prevent a category of bugs where the return value of open() is not checked and the file is then used. In order to avoid warnings in existing code, the marking can be opted in or out, by defining QT_USE_NODISCARD_FILE_OPEN or the QT_NO_USE_NODISCARD_FILE_OPEN macros. By default, Qt will automatically enable nodiscard on these functions starting from Qt 6.10. Change-Id: Ied940e1c0a37344f5200b2c51b05cd1afcb2557d Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* ResultReporter: fix uninitialized int memberDennis Oberst2024-04-111-1/+1
| | | | | | | | | Fixes Axivion(SV70842): Qt-Generic-InitializeAllFieldsInConstructor Task-number: QTBUG-122619 Pick-to: 6.7 6.5 Change-Id: I8ee378246df4767122ca91d65170cae82232044b Reviewed-by: Ivan Solovev <[email protected]>
* 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 <[email protected]>
* Doc: Qt Concurrent: Fully qualify \typedef documentationTopi Reinio2024-02-131-1/+1
| | | | | | | | | | | Upcoming changes to QDoc require API entities to be fully qualified; previously, QDoc maintained a list of 'open namespaces' that were part of matching the documented entity with its declaration, but that concept does not work for parallelized parsing where the order of processing can be arbitrary. Change-Id: I18dbe83716831451ef02153b24e94a70c3cf87a7 Reviewed-by: Luca Di Sera <[email protected]>
* Fix QThreadPool::maxThreadCount() usageIvan Solovev2024-01-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | The docs claim that QThreadPool always creates at least one thread. However, the user can (usually by mistake) request zero or a negative number of threads. The maxThreadCount() function is simply returning the value, that was requested by the user. Since it's a public API, it is used in several places in QtConcurrent, where it is assumed that the value is always positive. This can lead to a crash if the user sets zero as a maxThreadCount. Update all such places with std::max(maxThreadCount(), 1). Prefer this approach over changing the return value of maxThreadCount(), because its behavior is documented and tested. Amends 885eff053797d56f2e295558d0a71b030fbb1a69. Fixes: QTBUG-120335 Pick-to: 6.7 6.6 6.5 6.2 Change-Id: Id3b2087cec7fbc7a2d42febca6586f2dacffe444 Reviewed-by: Thiago Macieira <[email protected]>
* Doc: Fix \fn template arguments for Qt ConcurrentTopi Reinio2023-11-181-2/+2
| | | | | | | | | Upcoming changes to QDoc require accurate definition for template arguments in \fn commands. Task-number: QTBUG-118080 Change-Id: Ia905211d2b2bc5b49e5f9b50f2407544e939779d Reviewed-by: Luca Di Sera <[email protected]>
* Doc: Fix warnings and linking issuesTopi Reinio2023-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | Remove or replace links to examples that were removed or moved under manual tests. Replace code snippets that were quoting the now-missing examples. Fix documentation of QSet::removeIf(). Fix typo in documentation macro: Unknown command '\examplecateogry'. Add qtopengl, qtshadertools dependencies to Qt Widgets documentation project to enable correct linking to those topics. Mark all documentation sets in qtbase as free of warnings. Pick-to: 6.6 6.5 Change-Id: I058cd5f2063aa933ea310bceff906f05422a7cb2 Reviewed-by: Topi Reiniö <[email protected]>
* [docs] Link from QtConcurent::run() to QThreadPool::start(Callable&&)Marc Mutz2023-08-041-1/+5
| | | | | | | | | | | | | | | The latter is a better choice if you don't need the result QFuture. Describe the QThreadPool::start() overload in prose, since the signature changed in 6.6 from std::function<void()> to Callable auto&&. The chosen wording is compatible with both. Pick-to: 6.6 6.5 6.2 5.15 Fixes: QTBUG-111875 Change-Id: I9f67c2f7e4b221602bf1c35b72e5d38898a4f0c9 Reviewed-by: Leena Miettinen <[email protected]> Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* QtConcurrent::run: point return value ignorers to QThreadPool::start(Callable&&)Marc Mutz2023-07-311-5/+10
| | | | | | | | | | | | | | Use the new Q_NODISCARD_X macro to point users that ignore the QFuture returned from QtConcurrent::run() to QThreadPool::start(), which does the same thing, but doesn't return a future, so is better suited for the fire-and-forget use-case the OP of and commentators on QTBUG-111875 cited. Can't pick to older branches, since Q_NODISCARD_X is 6.7+. Task-number: QTBUG-111875 Change-Id: If0bf920ecc0fb59b9a9a9931ea9dc30f7abff1b7 Reviewed-by: Ivan Solovev <[email protected]>
* Make qYieldCpu() public APIThiago Macieira2023-07-251-2/+0
| | | | | | | | | | | Rewritten to be a bit simpler, added a few more yield/YieldProcessor alternatives, added RISC-V support. [ChangeLog][QtCore] Added qYieldCpu() function. Fixes: QTBUG-103014 Change-Id: I53335f845a1345299031fffd176f59032e7400f5 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Enable QT_NO_CONTEXTLESS_CONNECT for most of QtBaseGiuseppe D'Angelo2023-07-111-0/+1
| | | | | | | | | It's clean now, keep it as such. Enabling it for QtCore is still OK, because it just hides a function template declared in a header. Change-Id: I8e7dfae179732ba04241a6a3258c2d722e8259df Reviewed-by: Thiago Macieira <[email protected]>
* Use a global value for warning limit when testing documentation in CITopi Reinio2023-06-271-3/+0
| | | | | | | | | | | | | | | | | | | The most common limit for the maximum number of allowed documentation warnings is zero. Use a global value for 'warninglimit', adopted by all Qt module documentation projects that include the configuration from qtbase/doc/global. This allows for a temporary increase of the limit across all modules as needed - for example, when updating the QDoc binary that the CI provisions to a version that introduces new types of documentation warnings. Increase this base limit temporarily to 10 to help re-enable documentation testing in CI as it's currently disabled. Task-number: QTBUG-113326 Change-Id: I8b66951ca9324bcfaec3b5a7ec2cff544c62feb0 Reviewed-by: Paul Wicking <[email protected]>
* QFuture: mention the work-stealing algorithm in the docsDennis Oberst2023-06-201-3/+2
| | | | | | | | | | | | | | | | | | A number of users have explored the behavior and complained about it. Lets add a \note explaining this. The function in charge is QThreadPool::stealAndRunRunnable(QRunnable *), which is a private function, exclusively used by: QFutureInterfaceBase::waitForResult() QFutureInterfaceBase::waitForFinished() also update the documentation to reflect these changes accordingly. Fixes: QTBUG-112351 Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I839858cb449063d8af9bef64d2f35a6816a419b0 Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* 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 <[email protected]>
* Clarify module changes in Qt6Jaishree Vyas2023-05-091-1/+1
| | | | | | | | | Changed Briefs for better understanding Fixes: QTBUG-109324 Pick-to: 6.5 Change-Id: I15b0c0dc12b1bf96626fb8ea4ad16d04b2b118ca Reviewed-by: Kai Köhne <[email protected]>
* Rework imagescaling example to avoid potential crashesIvan Solovev2023-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Creating a continuation with QtFuture::Launch::Async policy does not work well with the example, because it still needs to update the UI once the async continuation is finished. If the user decides to close the application while the async continuation is executed, the next continuation will be accessing data from the destroyed Images object. Fix it by using QtConcurrent::run() to do the "heavy" work in a separate thread, and use a QFutureWatcher to handle the results of the async execution. Update the example documentation accordingly. After this patch the example still shows the usage of continuations and onCanceled()/onFailed() handlers. However, it now does not illustrate the usage of different launch policies and continuation contexts. It might not be a big issue, because the QFuture documentation describes these topics rather extensively. Fixes: QTBUG-103514 Pick-to: 6.5 Change-Id: I8142535064ff7a4e8007a5c0a8fe7709d6d942ec Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Jarek Kobus <[email protected]>
* QtConcurrent: fix warning due to assignment to narrower integer typeHamish Moffatt2023-04-031-3/+3
| | | | | | | | | | MSVC warns due to assignment of std::distance's return value (__int64) to int when warning C4244 is enabled. Pick-to: 6.5 Change-Id: I78360ec1bbe861b96d6875af3a29b77f419a3843 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* QtConcurrent: yield CPU when spinning on atomicsMårten Nordheim2023-02-281-0/+6
| | | | | | Pick-to: 6.5 Change-Id: I3eef19d8737da60bee40385a64a1bc136d2e7329 Reviewed-by: Thiago Macieira <[email protected]>
* Add QtConcurrent Examples pageIvan Solovev2023-02-243-1/+24
| | | | | | | | | | | | | The QtConcurrent examples were only discoverable from the "All Qt Examples" page, which was very inconvenient. This patch adds a separate page for all Qt Concurrent examples, and links to it from the module's main page. Pick-to: 6.5 Change-Id: Iecabd9e21033605c1ec74232ce4f3d68b0c78d82 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Jaishree Vyas <[email protected]>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-101-3/+0
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <[email protected]>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-2114-49/+49
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <[email protected]>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-232-2/+2
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Add license headers to cmake filesLucie Gérard2022-08-032-0/+6
| | | | | | | | | | | | 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 <[email protected]>
* Add \brief descriptions to QtConcurrent topicsSona Kurazyan2022-07-204-0/+4
| | | | | | | Fixes: QTBUG-104213 Pick-to: 6.4 6.3 6.2 Change-Id: Ib787546ef74133aca4b963a4341283147d2e8fb2 Reviewed-by: Edward Welbourne <[email protected]>
* QtConcurrent::ReduceKernel: fix race conditionsSona Kurazyan2022-07-201-0/+2
| | | | | | | | | | | | | resultsMapSize is modified inside the runReduce() method, and the writes are protected via mutex lock. However, reads of resultsMapSize through shouldThrottle()/shouldStartThread() (that can be called by multiple threads) are done without a lock. Added the missing locks. Task-number: QTBUG-104787 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I700e7b66e67025bc7f570bc8ad69409b82675049 Reviewed-by: Jarek Kobus <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* Add the qt_class pragma to file listed in sync.profile classnames mapAlexey Edelev2022-06-223-0/+12
| | | | | | | | | This makes header files self-contained and reduces the number of 'sources of truth' for syncqt procedure. Change-Id: I7f5865abc69934603139d23e1b5452da46ccb110 Reviewed-by: Jörg Bornemann <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* QtConcurrent: prevent conversion of ReduceOption to initial valueSona Kurazyan2022-05-204-41/+81
| | | | | | | | | | | | | | | | | | | | | | | | QtConcurrent map- and filter-reduce functions take an initial value, which can be of any type that is convertable to the result type. The side-effect of this is that the enum values passed as ReduceOptions can be treated as an initial value (if they are convertable to the result type) which will result into a wrong overload call. To avoid this, added additional check to make sure that the initial value type doesn't match with ReduceOption enum. Note that this required including the qtconcurrentreducekernel.h header in qtconcurrentfunctionwrappers.h (which contains compiler checks for QtConcurrent) for accessing ReduceOption enum, so I had to get rid of qtconcurrentfunctionwrappers.h include from qtconcurrentreducekernel.h to avoid circular header includes. This, in turn, required moving the QtPrivate::SequenceHolder helper type to qtconcurrentreducekernel.h, which didn't belong to qtconcurrentfunctionwrappers.h anyway. Pick-to: 6.3 6.2 Fixes: QTBUG-102999 Change-Id: Ieaa8ef2e4bd82ce2ada2e0af9a47b87b51d59e87 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-1630-1124/+60
| | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Do not highlight the Image Scaling Example anymore in Qt CreatorKai Köhne2022-02-171-2/+0
| | | | | | | | Pick-to: 6.3 Fixes: QTBUG-100645 Change-Id: I9f2e2c022a00a024917327028b403d36ca2a4b48 Reviewed-by: Kimmo Leppälä <[email protected]> Reviewed-by: Sona Kurazyan <[email protected]>
* Remove mentions of QtConcurrent::runWithPromise from docsSona Kurazyan2022-02-112-15/+8
| | | | | | | | | | | | cf043a785ac9357e8f1283ea9e1496261af2b1a5 unified QtConcurrent::run() and QtConcurrent::runWithPromise(). Remove the last mentions of runWithPromise. Also did some minor cosmetic improvements. Pick-to: 6.3 Change-Id: Ie3b39600978ccfa4a009d3ff68567a348dc7b166 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Jarek Kobus <[email protected]> Reviewed-by: Leena Miettinen <[email protected]>
* Fix memory leak in QtConcurrent::run when called with a NULL QThreadPoolSona Kurazyan2022-01-241-0/+1
| | | | | | | | | | QThreadPool automatically deletes the runnable after it finishes running the task. In case QThreadPool is nullptr, we should delete the runnable manually. This amends 87b93c29be02f0a7ff9424b5e2b6431e20bd4c40. Pick-to: 6.3 6.2 5.15 Change-Id: Id7e4ed3d4d6de05990edf62e4099852983debc64 Reviewed-by: Mårten Nordheim <[email protected]>
* QtConcurrent: use variable templates for compile-time checksSona Kurazyan2022-01-203-17/+10
| | | | | | | | | Noticed during the API review. Pick-to: 6.3 6.2 Task-number: QTBUG-99883 Change-Id: I19571343a0cf0609beae2422ef1f69f7a34eb9ac Reviewed-by: Fabian Kosmale <[email protected]>
* QtConcurrent::run crashes on program exitTianlu Shao2021-12-201-1/+7
| | | | | | | | | | | | When an application is about to be closed and all the destructors are called, if there isQtConcurrent::run on the way, it crashes as the internal threadpool pointer is nullptr. Fixes: QTBUG-98901 Pick-to: 6.2 6.3 Change-Id: Idd84d1518fc6a225263e6666a0f1de2ccef79c82 Reviewed-by: Sona Kurazyan <[email protected]>
* 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 <[email protected]>
* Doc: Enable qdoc warning count limitVenugopal Shivashankar2021-10-211-0/+3
| | | | | | | | This should restrict changes that introduce new warnings. Change-Id: I7e4b5d9d5d84b7c336509c380bc7e6d86e360f4a Reviewed-by: Topi Reiniö <[email protected]>
* concurrent: Fix typo in documentationJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ibe3715de704f420ba3796d19c9e78cd6204eb4e5 Reviewed-by: Lars Knoll <[email protected]>
* concurrent: Fix namespace typoJonas Kvinge2021-10-121-1/+1
| | | | | Change-Id: I7fed1f3965f97a4e1c4d096bc19f98572ea35c53 Reviewed-by: Mårten Nordheim <[email protected]>
* Remove checks for features available in C++17Ievgenii Meshcheriakov2021-10-021-2/+0
| | | | | | | | | | This patch removes most of the checks that are made using C++20 __cpp_* macros for features available in C++17 and earlier. Library feature check macros (__cpp_lib_*) are unaffected. Change-Id: I557b2bd0d4ff09b13837555e9880eb28e0355f64 Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* Fix QtConcurrent::blockingMapped to work with non-template sequencesSona Kurazyan2021-09-081-1/+7
| | | | | | | | | | | | | | | The code for deducing the type of output sequence was assuming that the input sequence is always a template class and was trying to use the corresponding container type for the output sequence. Fixed the deduction code, to assume that the output sequence has the same type as the input sequence, when it's not a template class. Also added tests to verify that all QtConcurrent functions support non-template input sequences. Fixes: QTBUG-30617 Pick-to: 6.2 6.1 Change-Id: I486fe99f3207cfff5dcceb3712cc7de863067edb Reviewed-by: Mårten Nordheim <[email protected]>