summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QObject: optimize err_ functions for sizeMarc Mutz24 hours1-10/+25
| | | | | | | | | | | | | The compiler cannot look into format strings and extract common parts for us. We need to do it manually. Saves more than 400B in text size on optimized GCC 15 C++26 unity AMD64 builds. Pick-to: 6.10 6.8 6.5 Change-Id: Ia8db139d9a1fc219a84eaec42c6f72dc9dc9d135 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QMetaContainer: Optimize iterator comparison a bitUlf Hermann45 hours1-4/+4
| | | | | | | | | | | If the iterator pointers are the same, then the iterators are the same and their distance is 0. No need to call any functions for this. This also makes empty container interfaces less dangerous. The resulting containers are simply empty, too. Change-Id: I64896fdaa391e97e46430233a74071aadf20f0ea Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Remove unnecessary #ifndef Q_QDOCPaul Wicking3 days1-4/+0
| | | | | | | | The #if-ery is not needed and confuses documentation authors. Get rid of it. Change-Id: Icd6cfd9baa1389eadc87a03ec0583767ae0a3fb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use Q_ENUM/Q_FLAG instead of Q_ENUMS/Q_FLAGSAhmad Samir9 days1-3/+2
| | | | | | | | | Q_ENUMS and Q_FLAGS have been deprecated since at least Qt 6.0. Task-number: QTBUG-99060 Change-Id: Ia8cbc607c34683dec99587571c0d04f1854e77c2 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qtmetamacros.h: sort out Q_{ENUM,FLAG}* when Q_MOC_RUN is definedAhmad Samir9 days1-1/+3
| | | | | | | | | | | | | | | | | | When Q_MOC_RUN is defined, some Q_ENUM/FLAG related macros are defined as themselves, whereas some other ones are missing. It's not obvious what the exact purpose of having those macros defined when Q_MOC_RUN is defined, but until we know better, add macros that we think are missing from the list. This also fixes a typo (s/Q_FLAGS/Q_FLAG/) from commit 14583137ae445fbfdc82922266f5c0736454f6c4. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-99060 Change-Id: I096a774baffc05826320af5454563a7825ce064f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qtmetamacros.h: fix comment of two #endifAhmad Samir2025-11-131-2/+2
| | | | | | | It starts with `#ifndef QT_NO_META_MACROS`. Change-Id: Ibd065b7b3432d1b8e6ab81e913c09bdcddc5173f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qtmetamacros.h: remove redundant Q_PRIVATE_QPROPERTYAhmad Samir2025-11-131-4/+0
| | | | | | | | | It was removed in commit e6988d4d0bef2c3f474576250cb305a2f00a688b. Pick-to: 6.10 6.8 6.5 Change-Id: Ia376c11cb8ace52472260cbde6424b9d1c082c97 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qtmetamacros.h: don't use Q_ENUMS/Q_FLAGS in {Q_ENUM,Q_FLAG}{,_NS}Ahmad Samir2025-11-131-4/+4
| | | | | | | | | | | | Q_ENUMS and Q_FLAGS have been deprecated since at least Qt 6.0. Since the behavior doesn't change at all, pick it to stable branches to reduce git merge conflicts for backports. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-99060 Change-Id: Ib4153897b3e178d810627ab2a54f72b202a6b06b Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QVariant: remove pointless castMarc Mutz2025-11-111-1/+1
| | | | | | | | | | | | | | | | Placement new wants to be called with a void* (cf. VOIDIFY() in std::construct_at()'s definition), so stop there, don't continue to cast to char*. This was already done for the primary overload of the in-place constructor, but forgotten in the initializer_list one. Amends c81e8f8ff24d30cc4c137d6f071954958e984ce9. Pick-to: 6.10 6.8 Change-Id: I5fe43d0062f2ad5e88603d5d231c2053f1164fed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QCoreApplication: use unique_ptr in PermissionReceiverMarc Mutz2025-11-071-1/+1
| | | | | | | | | | | | | ... not shared. Amends 0bd1fc006097e481d8b92ee1c5246ffa1ae9379f, which removed the need for SlotObjSharedPtr, but didn't adjust the data member. Pick-to: 6.10 6.8 Change-Id: If5991d20b091271f9e38e2f621eb62020cee9871 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: Check entitlements directly for app sandbox detectionTor Arne Vestbø2025-11-071-46/+4
| | | | | | | | | | | | | | | Checking entitlements via the code signing verification machinery of SecStaticCodeCheckValidityWithErrors is potentially slow (may even reach out to the network, in some cases). We were mitigating this by spinning up a short lived thread to resolve the state before it was needed, but pulling the sandbox state out of the entitlements directly removes all this complexity, and is 4x faster for those times we would end up blocking waiting for the thread to finish (3-4ms vs 20ms). Pick-to: 6.10 6.8 Change-Id: I069b5bb576464b6add92dc9d37fdf116f3553d0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* macOS: Add private API to get a process' entitlementsTor Arne Vestbø2025-11-072-0/+16
| | | | | | | | | There's unfortunately no public API for this on iOS or other non-macOS Apple platforms. Pick-to: 6.10 6.8 6.5 Change-Id: Ib4ef0f021ae44c9df89764215bcafecc1e7c29ad Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Core: Provide non-broken implementation of QVariant{Ref|Pointer}Ulf Hermann2025-11-052-1/+283
| | | | | | | | | | We need to store the pointed-to value so that it stays stable even if the original is iterated further. Task-number: QTBUG-140181 Pick-to: 6.10 6.8 Change-Id: I59891210577e58f7360019d436b3985b4f9a4cd1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCoreApplication: mark applicationPid() noexceptThiago Macieira2025-11-012-2/+2
| | | | | | Pick-to: 6.10 6.8 Change-Id: Ia3982aa4c68bec07fb09fffd2e08ca332e6d00bf Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Add note about limitations of permission API typesTor Arne Vestbø2025-11-011-0/+4
| | | | | | | Pick-to: 6.10 6.8 Change-Id: I638587825d6aa4680467205bff785b5c69aaa8ed Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Mark Q{Sequential|Associative}{Const|}Iterator as \internalUlf Hermann2025-10-292-0/+20
| | | | | | | | | They've never been documented properly and otherwise produce qdoc warnings. Now that they're deprecated, we don't need to start documenting them anymore. Change-Id: I7686a974f9c97c6198e36bd466e9744e815a8c5c Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* QObjectPrivate::connectImpl: remove unnecessary check we've already doneThiago Macieira2025-10-241-1/+1
| | | | | | | | | We checked above that if the UniqueConnection bit is set, slot is not null. Pick-to: 6.10 6.8 Change-Id: I1a323f917be73c0653cefffd852e46ca8b0fa22f Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QObject: use connectWarning() moreThiago Macieira2025-10-231-18/+19
| | | | | | | | Drive-by mark it cold, like the other error functions above it. Pick-to: 6.10 6.9 6.8 Change-Id: I2e4b0c0cad3d04ed7597fffd9616301fc736ed2e Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QMetaObjectBuilder: Fix detecting enum properties from QMetaTypeFriedemann Kleint2025-10-201-1/+1
| | | | | | | | | Fix condition wrongly inverted by dd95d5126ce9e022dfd25f0f44ee0f2a9e50f45e. Fixes: PYSIDE-3217 Pick-to: 6.10 Change-Id: I3c30541617a90ac32020aaddfca79024ba1ba351 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTimer: fix clang -Wshorten-64-to-32 warningsAhmad Samir2025-10-181-11/+16
| | | | | | | | | | | | | | std::chrono::milliseconds::count() does not return int, so assigning the result to an int variable triggers said warning. Fix by using q26::saturate_cast<int> and checking (or asserting) that the value didn't change. Amends 1ca89b65d85c5df971fac7c1f9d5678e0e0cf45b. Pick-to: 6.10 6.8 Change-Id: I419c931d04b533402335568cc2e9569cc627f117 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinRegistryKey: de-pessimize stringValue()Marc Mutz2025-10-151-1/+3
| | | | | | | | | | | | | | | | | | | Don't create a QString object that we might not need (if the optional already contains one). Using value_or() with an argument that is not of trivial type is like having a function default argument of the same type: it's constructed whether we need it or not; one should use overloading instead (QTBUG-98117). Rewrite to the equally-readable check-and-return-else-default-construct. Amends 40523b68c14bf618bdc2d5438deebf34627be3af. Pick-to: 6.10 6.8 Task-number: QTBUG-98117 Change-Id: Iecd7fa9c3705c8416b5609e6d157079e10bfca59 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QObject: docs: clarify that "window system events" means the event loopAhmad Samir2025-10-151-2/+2
| | | | | | | Fixes: QTBUG-140923 Pick-to: 6.10 6.8 6.5 Change-Id: Ia8ee47715f787847204c3addf2d2d0e85e202685 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Core: Move QMetaSequence docs and implementation to own fileUlf Hermann2025-10-142-468/+479
| | | | | | | | | | | This is in preparation for adding further inner classes to QMetaSequence that can't live in qmetacontainer.{h|cpp}. Also fix bogus references to QMetaSequence in QMetaContainer. Pick-to: 6.10 6.8 Task-number: QTBUG-140181 Change-Id: Ieed1a3766c7d9f930eac08e6c132e3b664a97ba7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Core: Add documentation for QMetaAssociationUlf Hermann2025-10-142-23/+299
| | | | | | | | | | | | The documentation was missing. Create the documentation in a separate file, in preparation for adding further inner classes to QMetaAssociation that can't live in qmetacontainer.{h|cpp}. Also, move the two out of line methods into the same file. Pick-to: 6.10 6.8 Task-number: QTBUG-140181 Change-Id: I907ced8446ff0d63bcf73ae601130d541816402b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Mark QWinRegistryKey as security-criticalMarc Mutz2025-10-132-0/+2
| | | | | | | | | | | | | | | | It's a data parser, even though the parsing is generally rather trivial, but it's also low-level, with unsecure C APIs being called. The data is external, because the Windows registry is open like the file system is. So if parsing from the file system is critical (cf. QSettings), then so is parsing from the registry. The header only contains trivial implementation, so mark it as significant. Task-number: QTBUG-135190 Pick-to: 6.10 6.8 Change-Id: I44ad39ec12460e862f97911bc68166cb2f7122cf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QWinRegistryKey: disable moves and swap()Marc Mutz2025-10-131-0/+5
| | | | | | | | | | | | | | | | | | | Since 589bfddc7c44a92e7e3f98a1e73871793c153ab7, the class is-a QObject and has a new data member, m_keyChangedEvent. Neither swap() nor the move SMFs handle the new member, and it's unclear how they should handle it, seeing it is tied to both m_key and the QObject identity of its enclosing class, the latter of which cannot be moved or swapped. De-QObject-ify'ing the class again (QTBUG-140671) would allow to define the semantics of subsribing to valueChanged() notifications vis-a-vis move semantics. Until then, and as a hot-fix, disable the move SMFs and swap(). Task-number: QTBUG-140725 Pick-to: 6.10 Change-Id: I9cecbe2afb98e5caa6889c2591fdd6a59106dab3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Silence NewDeleteLeaks warning for QMetaObject::invokeMethodMike Senter2025-10-081-1/+2
| | | | | | | | | | | | Using the functor version of QMetaObject::invokeMethod resulted in a NewDeleteLeaks warning from clang-tidy. There was a NOLINTNEXTLINE at the source of the problem, but it was placed incorrectly. This replaces it with NOLINTBEGIN/NOLINTEND wrapping around the problem lines. Pick-to: 6.10 6.8 Change-Id: I351f1a4691648a12d3e0f6c2da4ecef8adce5714 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Core: Decouple QIterable from QMetaContainerUlf Hermann2025-10-082-2/+8
| | | | | | | | | | | Technically, the thing we're iterating over doesn't have to be a QMetaContainer. It's templated all the way. Only in one place we accidentally referenced QMetaContainer and that should be just "auto". Task-number: QTBUG-140181 Pick-to: 6.10 6.8 Change-Id: Ic6b129822345f9ef4c9a117eb4a3e84cbcc148c3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add qTrId() alias for qtTrId()Masoud Jami2025-10-081-0/+5
| | | | | | | | | | | | | | | | | Remove the outdated comment about qTrId() being reserved for QStringFormatter, which never materialized. Add qTrId() as an inline alias for qtTrId() to provide the more intuitive function name for id-based translations in C++ code. The support in lupdate and the tests are added in a patch for qttools: I9047cb97 The original qtTrId() function remains available for compatibility. [ChangeLog][Core] Added qTrId() alias for qtTrId(). Fixes: QTBUG-134544 Change-Id: I415797b236bff987c87e627e5e422899dda30d92 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QTimer: remove the int overload of singleShotImplThiago Macieira2025-10-061-9/+9
| | | | | | | | | | | And just convert the interval with a private, static member. It's effectively the same thing, but simplifies for when I'll need to modify this singleShotImpl() implementation. Amends commit a4a679ee796a476048ddee3f88025035cca3631a. Change-Id: I62d0a719d8cfd43f4dd3fffd8f73577696d48f53 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QObject: use a view instead of allocating a temporary QByteArrayAhmad Samir2025-10-061-3/+3
| | | | | | | | | | | | | Also use slice() since its preconditions are checked. Drive-by, the function must have a name, so openParen must be > 0. Amends 352c8ef1997542de2d471a8d929442529b876263. Pick-to: 6.10 6.8 6.5 Change-Id: I15ef991eca4e5bd0dee39af94c13783e46ed7205 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QObject: fix Clang -Wshorten-64-to-32 warningsAhmad Samir2025-10-061-7/+7
| | | | | | Pick-to: 6.10 6.8 6.5 Change-Id: If1bcdc1e99857c8e9b4580d2d49e271eb29238fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Mark QCoreApplicationPrivate::removePostedEvents() as internalDavid Boddie2025-10-061-0/+1
| | | | | | | | | This suppresses the warning about QCoreApplicationPrivate being undocumented. Pick-to: 6.10 Change-Id: I8bad4f06e46e722fe96a0b2cdaa05a083ec559dd Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QObject: take by QSpan in static helper functionAhmad Samir2025-10-061-3/+3
| | | | | | | | Instead of passing by a pointer and length. Pick-to: 6.10 Change-Id: I591f67a1af0ef10af9456adc009f21eb2cc6a1a3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: fix clang narrowing conversion warnings -Wshorten-64-to-32Ahmad Samir2025-10-061-1/+1
| | | | | | | | | | | | | | qlogging.cpp: ::backtrace() takes an int. QLoggingSettingsParser: fgets() takes an int. QFileSystemEntry: filePath() would never exceed PATH_MAX on Unix; and on windows even with the extended long path option it should fit in an int: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation Pick-to: 6.10 6.8 6.5 Change-Id: I288f4adc71740e077ed0c11de4e38f6fddc00455 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinRegistryKey: fix buffer overflow in ctor and value()Marc Mutz2025-10-042-17/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String views (like QString) need not be NULL-terminated. However, on QString, calling utf16() will NULL-terminate; but not so on QStringView. If the functions are passed non-NULL-terminated string views, they may either overflow the underlying buffer (causing UB) or read past the intended end of the data, accessing a different key (e.g. "data32" instead of "data"). Fix by porting from QStringView to {const wchar_t*, QString} String views work very badly when the function taking them needs to call C APIs that expects NULL-terminated strings, because string views, in general, are not NULL-terminated. So don't use them here. Use const wchar_t*, and, for the time being, overload with QString. The goal should be to kick the QString uses out and replace them with std::wstring, to reduce the impedance mismatch of char16_t-using QString and wchar_t-using Win API. All calls are either passing QString or const wchar_t* already, except the test, which passed QStringView, so ported that to const wchar_t*. Amends 05a829f923a88e69b2ceaa372820a2dcb8c083cd. As a drive-by, Extract Method to_optional<T>() from value<T>(), and, in it, use the new-ish rvalue overload of qvariant_cast, amending 40523b68c14bf618bdc2d5438deebf34627be3af. Pick-to: 6.10 6.8 6.5 Change-Id: If27a0cb5e1e10e664b794593a5dad5ee85d9e678 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: warn about using SLOT macro with non-slot functionsAhmad Samir2025-10-022-2/+33
| | | | | | | | | | | | And make it no-op in Qt7. [ChangeLog][QtCore][Important Behavior Change] A warning will be shown if the SLOT() macro is used with a function not marked as a slot, but it'll continue to work to keep backwards-compatibility. However in Qt7 the SLOT() macro will be no-op for non-slot functions. Change-Id: I9ea112b7a72a26fcc5548ebc3c0220eab19d0455 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaObjectPrivate: refactor indexOfMethodRelative()Ahmad Samir2025-10-022-17/+31
| | | | | | | | | | | | | | As requested in code review, use QMetaMethod::MethodType enum instead of QMocConstants::MethodFlags, to specify which type to search for; MethodFlags has many more irrelevant enumerators wrt. this function. Make it a regular function instead of a template; take the type to search for as a parameter. Use a switch-statement instead of ternaries, for better readability. Change-Id: I699b2a146019b9f4cd4fb5441de6cae151ecce78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: disconnect(): don't normalize signatures unconditionallyAhmad Samir2025-10-021-29/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | First try the method signatures as-is, and only if that doesn't work, try normalizing them. Remove the `try` blocks because now they are redundant, catching to just rethrow isn't useful (as pointed out in the code review): if (sender->metaObject()->indexOfSignal(signal) == -1) { try { pinnedSignal = QMetaObject::normalizedSignature(signal); signal = pinnedSignal.constData(); } catch (const std::bad_alloc &) { rethrow; } ... } Call err_method_notfound() and co. earlier; if the signal or slot isn't found in the metaobject, it won't be found in its super-classes. Using normalized signatures has always been the recommended way of using string-based {dis,}connect(), so if you still don't use normalized signatures in your code, you pay the extra overhead. Task-number: QTBUG-135819 Task-number: QTBUG-135572 Change-Id: I38d545ecd0589493cfb3532b17917afee192f212 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaObject: document what a "cloned" function is wrt. the meta-objectAhmad Samir2025-09-302-4/+10
| | | | | | | | This is copied, with some modifications, from the comment in handleDefaultArguments() in moc.cpp. Change-Id: Idef95f3873ae3e7447ee4065adbc14ca5e34a57f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: disconnect(): rearrange the code for better readabilityAhmad Samir2025-09-301-10/+10
| | | | | | | | De-duplicating the code in a couple of places. This also helps make the next patch in this series more focused. Change-Id: Ia0435c43ae9eaa55c3d3e77f8a4f4c7be677cbf2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinRegistryKey: remove unused qpair.h includeMarc Mutz2025-09-301-1/+0
| | | | | | | | | | | Amends 87361727ffafbee460970cdb8e72056653fd2443, which removed the last use of QPair from the file, but not picking to older branches in case users rely on the transitive include. Task-number: QTBUG-115841 Pick-to: 6.10 Change-Id: Idba1980b3309635f24d830e2a922beaeff600c55 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QObject: disconnect(): optimize finding the index of `method`Ahmad Samir2025-09-301-2/+12
| | | | | | | | | | | | | | | | | If `method` is wrapped in the SLOT() macro, we can skip searching signals by using indexOfSlot(). Note that the string-based connect() overload uses the same technique. In disconnect() there is one more usage of indexOfMethod(), but the whole `try` block containing it will be refactored in a subsequent commit. Use a named-lambda, because it'll be re-used in later commits. Task-number: QTBUG-139128 Change-Id: I7ac8417bf90e7f15c121163e4167af5ec2e00c9f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinRegistryKey: don't use qSwap()Marc Mutz2025-09-301-1/+4
| | | | | | | | | | | | We know the type of m_key (it's a pointer), so use qt_ptr_swap() instead of the expensive-to-compile qSwap() ADL-enabler. Amends 05a829f923a88e69b2ceaa372820a2dcb8c083cd. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-97601 Change-Id: I125908270765b6dbb3472f663c410309235a9b72 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Mark QVariant as security-criticalMarc Mutz2025-09-303-0/+3
| | | | | | | | | | | | | | | | | | | | If QVariant was just a container (open sum type, like std::any), the story would end there, and it could be marked as security-significant, the default, like QList. Both are used all over the place in Qt, but, crucially, QList doesn't interpret its contents. QString does, so it's security-critical. Unfortunately, QVariant also interprets its contents (it performs conversion between content types), and there's also load(QDataStream&), so this can't be anything else but critical. Both headers are full of implementation most of which can't be called trivial, so the headers are critical, too. Task-number: QTBUG-135190 Pick-to: 6.10 6.8 Change-Id: I12688f502b6362f2f541a5aba012c80677dbfef9 Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
* Fix Android builds with QT_FORCE_BUILD_TOOLS=ONAssam Boudjelthia2025-09-301-2/+2
| | | | | | | | | | | | | Bootstrapped builds don't have streamable qCDebug() calls, so use printf style. Also, QJniObject can't be used in this build type, so guard it under QCoreApplicationPrivate::appVersion(). Fixes: QTBUG-140516 Pick-to: 6.10 6.8 Change-Id: I912e57689f758627ef6ca63405b557940adbf186 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: work around wasm64 stringToUTF16 issueMorten Sørvig2025-09-291-0/+7
| | | | | | | | | | Work around https://github.com/emscripten-core/emscripten/issues/25315 by converting strings via std::u16string. Pick-to: 6.10 Change-Id: Idcb01687cda4ae250c7b3a37098288c4fc2c9428 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
* Revert "QObject: clarify what `method` is in string-based (dis)connect ↵Ahmad Samir2025-09-261-13/+0
| | | | | | | | | | | | | | overloads" This reverts commit 6f353fc17a3a6f1786359df36db209d6c5b0fa42. As pointed out in code review, using SLOT() to find a Q_INVOKABLE method isn't the intended behavior; it should only work with functions declared as slots; pointed out by Thiago in code review. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I000438b7901a8eb0392731564005bfdd85740c77 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Core: Make retrieveElement() semi-public and inlineUlf Hermann2025-09-263-20/+7
| | | | | | | | | | | Some of the iterable methods are only out of line and exported because that function is private. Since we need to re-write the iterables anyway, let's not make this mistake again. Pick-to: 6.10 6.8 Task-number: QTBUG-140181 Change-Id: If5cb255f9c95403d1e8611721b3275403602794b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move all Q_DECL_(PURE|CONST)_FUNCTION markers to the frontMårten Nordheim2025-09-193-8/+8
| | | | | | | | | While testing defining Q_DECL_PURE_FUNCTION for MSVC I discovered it cannot handle having the marker trailing, while GCC/clang can cope with either. Change-Id: Ic9dd088996c191263e2f2a43c2f6a16533bdb9c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>