summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Extend documentation for QFile:copy()Paul Wicking2021-06-232-10/+15
| | | | | | | | | | | | - Add information about symlinks and file metadata. - Reflow text. - Extract text common to both overloads to a .qdocinc file for consistency and to avoid duplication. Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-94706 Change-Id: I3c730fd63f4018a1a573bb56751fedd2270a3247 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject::disconnect: remove dead codeFabian Kosmale2021-06-231-8/+0
| | | | | Change-Id: Id82ee3d0fb04d89e498cf05d0c0be33c4fe03e86 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use UTC when parsing only a date or only a time, not a date-timeEdward Welbourne2021-06-231-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | This should reduce the amount of fall-out from DST complications. Also document the assumptions of QDateTimeParser's two fromString() methods (and fix the punctuation on the QDateTime parameter). Adjusted some tests to match. Since only QDateTime-returning methods will show the difference, and it's at least somewhat odd to be using those on QDateEdit or QTimeEdit, this should have little impact on API users. [ChangeLog][QtCore][Behavior Change] QDateEdit and QTimeEdit now operate in UTC, to avoid spurious complications arising from time-zone transitions (e.g. DST) causing the implicit other half to combine with the part being edited to make an invalid result. Returns from their dateTime() and other methods returning QDateTime (max/min) shall thus be in UTC where previously they were in local time. QDateTimeEdit continues using local time. The default can be over-ridden by setTimeSpec(), as ever. Change-Id: I44fece004c12342fe536bbe3048217d236fd97b2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix coding-style violation in QUtf8StringView::operator==()Edward Welbourne2021-06-231-3/+3
| | | | | | | Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I00a9c14963fe8f8d1b524350aec5544ff5dd609c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename PermisionType to spell permission correctlyEdward Welbourne2021-06-236-13/+16
| | | | | | | | | Thanks to Giuseppe for pointing it out in API change review. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I3b8fb653b5efa7ded51f81aadb35d361e7dbf19c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Coding style: remove redundant braces, break long lineEdward Welbourne2021-06-231-4/+6
| | | | | | | Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: Id9bbc3871bc3350fa5cc656f4248de8e6511ff05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix handling of day-of-week in QDateTimeParser and QDateTimeEditEdward Welbourne2021-06-231-21/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDTP's absoluteMax(), setDigit() and getDigit() simply treated day-of-week as synonym for day-of-month. Consequently, QDTE::stepBy() did the same. This meant that wrapping happened at the month boundary, so would jump within the week if it wrapped around, otherwise the up/down arrow would "jam" at a particular day of the week when further steps would leave the month. Instead, when wrapping, wrap round the week while still moving the day-of-month to match, jumping back or forward a week to stay within the month on hitting a month boundary; otherwise, stop backwards stepping on hitting the locale-specific day of the week, or forward stepping when the step would be to or past this first day. Fixed various bugs found in the course of testing this. [ChangeLog][QtWidgets][QDateTimeEdit] Corrected handling of weekdays. Previously, changes to the week-day were simply changes to the day of the month. Weekday fields are now handled as such: changes to them do change the day of the month, but a change that would step past the end (or start) of the month is adjusted to the relevant day of the nearest week within the month. When wrapping is disabled, the locale-specific first and last days of the week are the bounds. Formats which specify day of week but not day of month will now preserve day of week when changing month or year, selecting the nearest day of month that matches. Change-Id: I7868b000fea7a4bc17a1b5687c44bcd56d42ae90 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Enable QT_TYPESAFE_FLAGS for bootstrap and QtCoreGiuseppe D'Angelo2021-06-231-0/+1
| | | | | | Change-Id: I5c64a29ffecece9e527f5db78cceb912836153d3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QF*Engine: port a couple of QFlags->int implicit conversions to toInt()Giuseppe D'Angelo2021-06-232-4/+4
| | | | | Change-Id: Iafc3527941a0b56a680322e3bc05b4046e560e89 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: port away from QFlags<->int conversionsGiuseppe D'Angelo2021-06-231-2/+2
| | | | | | | Use fromInt/toInt. Change-Id: I4af833e432fec2156c4ab96211b2bbc48aedd7cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: remove QEventLoop workaroundsMorten Sørvig2021-06-231-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | In general, QEventLoop::exec() _can_ be used as-is on WebAssembly, provided that the event dispatcher supports the use case. Use cases that can work include calling exec() on a secondary thread, or calling exec() on the main thread if asyncify is used. Some use cases will still require special casing for Wasm, such as the non-asyncified QApplication::exec(), but that can be handles closer to where the workarounds needed, for example in QApplication. This removes the partial support for nested event loops on the main thread, which did not really work. Also, we no longer call emscripten_force_exit() on QEvetLoop::exit(), which makes it possible to exit a top-level event loop without exiting the process. Task-number: QTBUG-70185 Change-Id: I3a28f41b8547ed3ba1bdf6a835e6662483e34449 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Long live QT_TYPESAFE_FLAGS!Giuseppe D'Angelo2021-06-234-16/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds an opt-in mechanism to kill type-unsafe functions and implicit conversions of QFlags, therefore removing an entire category of bugs that QFlags itself is supposed to protect against: QFlags<E> f; f == 3.14; // OK; f->int, int->double, then operator==(double,double) f & UnrelatedEnum; // OK if of unscoped enum, calls operator&(int) f &= 123; // calls QFlags::operator&=(int) int i = f * 42; // f->int, then operator*(int, int) Thankfully, operator+ and operator- had already been deleted. By defining QT_TYPESAFE_FLAGS one: * disables operators taking (u)int, forcing the usage of an enumeration or another QFlags object; * turns the implicit conversions towards integers/bool in explicit (one can always use fromInt/toInt instead); * adds a convenience set of (in)equality operators against literal 0, in order to keep code like `(flag & bit) == 0` compile. This set can't be added normally otherwise it would add ambiguity; * adds the unary operator~(Enum), turning it into a flag. This is a source incompatible change, in general, so it's opt-in. This is a Qt-internal macro at this point. It can't be offered to users yet because we need to fix some public API flaws first: in some places (e.g. QPainter::drawText) we ask users to do type-unsafe manipulation of flags. A user enabling the macro wouldn't be able to properly use the functions in question. This macro will be enabled in a follow-up commit. Change-Id: I796f2256b446bafc12cdcbaf7de417d12bd3619e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringBuilder: fix warning about memcpying onto QCharThiago Macieira2021-06-221-1/+1
| | | | | | | | | | | | | Which is not a trivial class. qstringbuilder.h: In instantiation of 'static void QConcatenable<const char16_t [N]>::appendTo(const char16_t*, QChar*&) [with long long int N = 6]': qstringbuilder.h:402:35: required from 'static void QConcatenable<QStringBuilder< <template-parameter-1-1>, <template-parameter-1-2> > >::appendTo(const type&, T*&) [with T = QChar; A = char16_t [6]; B = QString; QConcatenable<QStringBuilder< <template-parameter-1-1>, <template-parameter-1-2> > >::type = QStringBuilder<char16_t [6], QString>]' qstringbuilder.h:460:52: required from 'QString& operator+=(QString&, const QStringBuilder<A, B>&) [with A = char16_t [6]; B = QString]' /home/tjmaciei/src/qt/qt6-release/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1762:75: required from here qstringbuilder.h:338:15: error: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'class QChar' from an array of 'const char16_t' [-Werror=class-memaccess] Change-Id: Iddb933f281024939b6acfffd1689cf320c84873c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QPodArrayOps: re-enable -Wstringop-overflowGiuseppe D'Angelo2021-06-231-6/+0
| | | | | | | | | | The spurious warning is not emitted any more by GCC 10 / 11. Even if it's still emitted by earlier GCC versions, now it's no longer an error. Change-Id: Ia8bf3e10905909c097ecc025bf89f818410a8dae Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: Respect precision when reading data for %.*s format stringUlf Hermann2021-06-221-4/+8
| | | | | | | | | | | If we disregard the precision we may read a very large string that we subsequently discard. Furthermore, people use this to read non-null-terminated strings, which randomly crashes. Pick-to: 5.15 6.1 6.2 Change-Id: Ifa255dbe71c82d3d4fb46adfef7a9dc74bd40cee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qsimd: Don't force RDRND on if __AVX2__Thiago Macieira2021-06-221-5/+4
| | | | | | | | | | | | Like AESNI, RDRAND is an optional extra feature that is not always enabled in all parts. Probably something to do with export restrictions, but I've only seen that in low-end parts. Drive-by removal of "AES" where it was no longer relevant. Pick-to: 6.2 Change-Id: I7246c3e7bb894e0d9521fffd168af3fc0fb638a1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QWindowsPipeReader::read(): do not switch the mutex twiceAlex Trotsenko2021-06-222-5/+10
| | | | | | | | We can get better performance if we omit unlocking the mutex before relocking it in startAsyncRead(). Change-Id: Ia012a71b95876d4f90c1dc4b7db5d7b267fca7a6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QWindowsPipeReader::read(): remove redundant checksAlex Trotsenko2021-06-211-5/+1
| | | | | | | | | An initial EOF check is not required here because the code below correctly handles this case. Also, the condition '!pipeBroken' means that the pipe reader is in the 'Running' state. Change-Id: I608d932c4e38f8224d9e655272e61295e55414e0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Do not apply not acceptable properties to the imported object librariesAlexey Edelev2021-06-211-5/+10
| | | | | | | | | | | | | If __qt_internal_propagate_object_library is used to propagate an imported object library we assume that the library is already compiled and no need to apply properties that may affect compiling and further linking of the target. Amends 3329212815777e33dfb4697b748d10927d73f44c Pick-to: 6.2 Change-Id: I2bd03264e286439fbed9067fa2c0a5c4a0097856 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix typosKai Köhne2021-06-211-1/+1
| | | | | Change-Id: I852fec49b23acaefb61284e347e63d86ba8331ae Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add note to Qt::MatchFlags about implementation dependent behaviorPaul Wicking2021-06-211-0/+5
| | | | | | | Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-94374 Change-Id: I7f426c92bf0434998d0793eedd405c1a682a28d9 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add missing limits includeNicolas Fella2021-06-201-0/+1
| | | | | | | | The code uses std::numeric_limits but is lacking the appropriate include Pick-to: 5.15 6.1 6.2 Change-Id: I41fa5ac4d8c4e06f35b5b1551ef2ad8417df80bd Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QProcess/Win: cleanup startProcess()Alex Trotsenko2021-06-191-17/+2
| | | | | | | | | Both the call to setProcessState(QProcess::NotRunning) and deleting the PROCESS_INFORMATION structure are redundant here. All this work was done by the previously executed cleanup() call. Change-Id: Iaf89f5edd2b661008a479d154e68974621b1b1eb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QEventDispatcherWin32: suppress old {FD_CLOSE|FD_CONNECT} notificationsAlex Trotsenko2021-06-191-3/+10
| | | | | | | | | | As with other network events, we must also ignore these notifications until WM_QT_ACTIVATENOTIFIERS message is received. Fixes: QTBUG-82835 Pick-to: 6.2 6.1 Change-Id: I0740bf22e8d1cb0e8b4eba7fc1a27ffe669973ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLocalSocket/Win: simplify flush()Alex Trotsenko2021-06-192-47/+0
| | | | | | | | | | Replacing a call to waitForWrite(0) with checkForWrite() changes nothing in logic, but saves one system call. As a result, unused functions in the QWindowsPipeWriter class have been removed. Change-Id: I34ec6310d9659f59a720056b9be54e31f2193116 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move the linking logic of the object libraries to a common functionAlexey Edelev2021-06-181-75/+113
| | | | | | | | | | | | | | | | | | | The linking logic of object libraries should be reusable outside of the resource context. This introduces a __qt_internal_propagate_object_library function that prepares all the necessary genexes to link and propagate the object library to the end-point executable. Rename resource object finalizer API to make the naming more generic to object libraries of any kind. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Pick-to: 6.2 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QProcess/Win: avoid double buffering on writeAlex Trotsenko2021-06-186-61/+52
| | | | | | | | | | | | | As QWindowsPipeWriter now maintains a chunk queue, there is no need to use the internal QIODevice buffer and wait for the previous operation to complete. This also allows us to get rid of the stdinWriteTrigger timer; however, as a trade-off, QWindowsPipeWriter now needs to accept data even before a handle is assigned. Change-Id: I17fe0e36a6165fe05100bfab3fe01fc0d880d617 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Allow destruction of QWindowsPipeReader in its signalAlex Trotsenko2021-06-182-19/+18
| | | | | | | | As a result, we can refrain from using the deleteLater() technique in QProcess and avoid long-lived soft leaks in blocking applications. Change-Id: I89e02b02551a668b995ad3d12d3ce9575b2dd9dd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Remove old configure-related filesJoerg Bornemann2021-06-182-2079/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Pick-to: 6.2 Task-number: QTBUG-89536 Change-Id: Ie827562f7fd2513d59f69234d77b8b93124ea78e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QHash: Fix erase() edge-caseMårten Nordheim2021-06-181-1/+4
| | | | | | | | | | | | | | | | | | | | | When the element you want to erase is the last element AND the next element (element 0), when rehashed, would be relocated to the last element, this leads to the state below. Which is similar to a test in tst_qhash for some seeds. auto it = hash.begin + (hash.size - 1) it = hash.erase(it) it != hash.end By forcing the iterator to increment if we were erasing the last element we always end up with a pointer which is equal to hash.end Befriend the tst_qhash class so we can set the seed to a known-bad one Pick-to: 6.2 6.1 Change-Id: Ie0b175003a2acb175ef5e3ab5a984e010f65d986 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QWinSettings: use QScopeGuard to RegCloseKey()Marc Mutz2021-06-171-7/+5
| | | | | | | | | RAII rulez. Change-Id: I32bc070ae3074f782a1695bcf2079de0fc19597b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QBindable: Use setter in setValue for QObjectCompatPropertyFabian Kosmale2021-06-171-0/+31
| | | | | | | | | | | | Directly writing to the underlying property storage has the potential of breaking all kinds of internal invariants. As we return QBindable in the public interface, we should not grant callers access to the internals of the object. Pick-to: 6.2 6.1 Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Silence a few warnings from excess semicolonsAllan Sandfeld Jensen2021-06-171-4/+4
| | | | | | | We dont really need those after functions definitions. Change-Id: I41f010a223977c55d4b7271ac3ebdc1bb9047b09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Set the plugin class name for qml pluginsAlexandru Croitor2021-06-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This is needed for a change in qtdeclarative to allow building the Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin. Show an error if the qml plugin has no class name, it's needed for plugin initialization so it's mandatory to have a class name. Show an error if a class name is not found when computing the import macro for a plugin (both for a regular qt plugin and a qml plugin). When querying for the class name of a target, query both a Qt6:: prefixed target as well as a non-prefixed one, with the Qt one taking precedence. This is to allow querying the class name of user project created qml plugins. Currently regular qt user plugins don't use the object library initializer approach. This will likely be revisited in the future. Pick-to: 6.2 Task-number: QTBUG-92933 Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Remove old add_qt_gui_executable APIAlexandru Croitor2021-06-171-6/+0
| | | | | | | | | | Repos should have migrated by now and the function should not be advertised as a public one. Pick-to: 6.2 Task-number: QTBUG-88763 Change-Id: Ica5bc55670a17a28c0022f78c126a3a8a8ffdeb5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Rename qt6_finalize_ios_app to be internalAlexandru Croitor2021-06-171-3/+2
| | | | | | | | | | | | For now, it's not meant to be called manually. It's called in qt_add_executable automatically for iOS. Amends 4d838dae5a821e9e5f013ba1d5a494ece1b5180e Pick-to: 6.2 Task-number: QTBUG-88763 Change-Id: I90dfcf86f53a3c8e48a813435f7400db232b21f4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QList: more explicitly document capacity() shenanigansAndrei Golubev2021-06-171-3/+4
| | | | | | | | | | | Due to capacity() reporting the size of all allocated space, this is somewhat inconsistent with what QVector::capacity() in Qt5 provided, due to Q6List being double-ended. So let's document this better Task-number: QTBUG-92941 Pick-to: 6.2 Change-Id: Iba46389121e721a8d21f0344b154f41c2c245867 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMimeBinaryProvider: cache comments and globPatternsAlexander Volkov2021-06-173-54/+62
| | | | | | | | Avoid multiple re-reads of xml files, for example in dolphin, which displays MIME type comments as file types. Change-Id: Ia124930e2a1fdc99d8a4d160f2288a00f55e0e8e Reviewed-by: David Faure <david.faure@kdab.com>
* Fix SSE4.1, RDSEED requirement for clang-cl buildsAllan Sandfeld Jensen2021-06-172-21/+5
| | | | | | | | | | | | | | A misunderstanding seems to have caused several files to be compiled with extra runtime arch options. We need to disable multi-target functions though, because it doesn't work with clang-cl headers. Task-number: QTBUG-88081 Task-number: QTBUG-88434 Pick-to: 6.2 Change-Id: Ic5829540f9007428c80f9a7bd46af35540745ccd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Porting Guide: Mention that also QSet is affected by stability of referencesKai Köhne2021-06-171-2/+2
| | | | | | | | | QSet is internally implemented by a QHash. Therefore the change in reference stability affects QSet, too. Pick-to: 6.1 6.2 Change-Id: If1879d5a027211bca0beeff16ffbc77f2f4fce26 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Porting Guide: Mention deprecation of QLibraryInfo::locationKai Köhne2021-06-171-0/+2
| | | | | | Pick-to: 6.1 6.2 Change-Id: I998a4575ce7fb56ab51d49715071e682a440360b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Porting Guide: Mention changed behavior of QCApplication::quit()Kai Köhne2021-06-171-0/+12
| | | | | | | | Mention change of behavior introduced by 89f7a2759c6b in the porting documentation. Change-Id: I3c282362f5852cc7768e6655fc7b3901d68f2b10 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Universally pass QMetaType by valueUlf Hermann2021-06-174-1/+6
| | | | | | | ... and add Qt7 TODOs where we can't because of BC. Change-Id: Idce8b677ae95231e1690ac4265dc6f06818052e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QObject: cleanup the orphaned connection lists on destructionGiuseppe D'Angelo2021-06-171-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a signal/slot connection is broken, it gets added to the sender's list of "orphaned connections", to clean up later. This cleanup happens when the sender gets destroyed or as soon as it emits any signal. This may cause soft memory leaks in case receivers get destroyed, and the sender is a long living object and doesn't emit signals for a while (e.g. QThread). For some reason, an explicit disconnection cleans up the list (either by using the QMetaObject::Connection object, or in case of string-based connect, using a string-based disconnect). This raises lots of doubts about why having this list in the first place. Fix the soft-leak by cleaning up the orphaned connection list when destroying a receiver. Note: I still believe that we shouldn't have any "orphaned" connection list, and rather cleanup on disconnect/deletion (otherwise, emitting a signal may cause a CPU spike because it triggers a cleanup). If we allow for any "impredictability" during signal activation we're just admitting that signals/slots aren't suitable for e.g. low-latency codepaths. That's why I'm not marking the problem as fixed. Original-patch-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Task-number: QTBUG-88248 Task-number: QTBUG-87774 Pick-to: 6.2 6.1 5.15 Change-Id: Id25f67a45dff49f740132a44d36e88740eb12070 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix crash in concurrent disconnectLars Knoll2021-06-172-21/+42
| | | | | | | | | | | | | | This does not fix all data races that we have in the system yet. One major issue is the virtual disconnectNotify(), that can be called from any thread and thus is inherently problematic, as it can collide with the object getting destroyed at the same time in another thread. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-88248 Change-Id: I9d841eb363b7e4f0de1657aeb8f5340d0fd55190 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cleanOrphanedConnectionsImpl: Allow to skip lockingFabian Kosmale2021-06-172-6/+26
| | | | | | | | | | | This function is/will be used in a few places where we already have a lock. Temporarily unlocking and relocking invites all kinds of troubles. By adding a flag we can instead tell the function that we already hold the lock. Pick-to: 6.2 6.1 5.15 Change-Id: Ibca089de61133661d5cd75290f2a55c22c5d013c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QOrderedMutexLocker: Disable copy and provide explicit dismiss functionFabian Kosmale2021-06-171-0/+37
| | | | | | | | | | | | | | | Copying a QOrderedMutexLocker is questionable, and would currenly easily lead to UB. Therefore we delete the copy ctor and copy assignment operator, and implement well-behaving move operators. In addition, provide an explicit dismiss method for cases where we don't want the locker to unlock the mutexes, as they have been manually unlocked (this could have been implemented previoulsy by using the copy assignment operator). Pick-to: 6.2 6.1 5.15 Change-Id: If2a888710e1c74277b28fd3e2939ab26fff0c7ae Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTextStream: fix a dead writeMarc Mutz2021-06-171-2/+1
| | | | | | | Found by Clazy. Change-Id: Iabe4fb23f63ea8df2142dc66cd16b04526b628c2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFileInfo: remove a couple of QFlags->int implicit conversionsGiuseppe D'Angelo2021-06-171-2/+2
| | | | | Change-Id: Iabfca134709852694967d605c6a93f34a9777d8a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Mention resource name on which rcc is runAlexandru Croitor2021-06-161-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I12189d7bf3fbe8544ae4c3478166515ea2759bec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>