summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Windows11Style: use 'More' icon for QToolBar extension buttonChristian Ehrlicher2025-10-284-1/+62
| | | | | | | | | | Use the windows font 'More' icon instead the Qt default png icon. This will make the icon work in dark monde with the windows11 style. Pick-to: 6.10 Task-number: QTBUG-140688 Change-Id: I1d8e1d820b08e8fa7a28f0445f049a571fb36520 Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
* QIOOperation: use std::get_if everywhereMårten Nordheim2025-10-281-6/+6
| | | | | | | std::get has code that uses exceptions. Change-Id: I9c2a46779bcf00ec9574432e7ca0383ce9288046 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Titlecase HTTP/1 headersMårten Nordheim2025-10-271-1/+14
| | | | | | | | | | | | | | | | | | | | Following the addition of QHttpHeaders and the relevant patches to port existing code to use it, we decided it was OK to start sending all header names as lower-case. This had the unfortunate side-effect that certain HTTP/1 servers did Case-Sensitive comparisons on the header name, causing them to stop functioning with Qt. To restore compatibility with these, we title-case them at the boundary to HTTP/1. Simply upper-case the first letter and the letter immediately following a dash. Ignores specific casing of raw headers, e.g. MyHeader turns into Myheader, and a lower-case header would still be titlecased. Fixes: QTBUG-137203 Pick-to: 6.10 6.8 Change-Id: Ic7ccf95eb7aa5cba355fc5933b7b9c86600821bb Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTables: separate Properties::cases from the restMarc Mutz2025-10-272-3375/+3827
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These entries are quite repetitive, esp. the all-zero entry for uncased characters (but not only: there are also 137 non-zero duplicates), and each one takes 8 bytes of the total 20 bytes of sizeof(Properties). Make a new array with these entries and only store an index into it in Properties. The new array happens to have a size of 448 entries (down from 3372 unique Properties), so 9 bits would suffice for the index, but a sizeof(Properties) == 14 is probably rather pointless, so add a reserved field to prop the struct up to 16. That sounds like the ideal size for rapid indexing and probably improves qGetProp() performance, esp. if case information is not needed. Theoretically, this should save 3372 * 4 - 448 * 8 = 9904 bytes. The TEXT size of libQtCore, however shrinks by a bit more, 10596 bytes, on optimized Linux AMD64 Clang 19 builds. Picking to all active branches, because the Unicode tables are still maintained in all of them. Fixes: QTBUG-139427 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: If4dc47ef06c674ad0263f0623ec408a25b977b3a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QLockFile: add some missing std::move()sMarc Mutz2025-10-281-2/+2
| | | | | | | | | | | | | | | Coverity complained that two QByteArrays were copied into the LockFileInfo struct when a move was possible. It's correct. Add the moves. Amends 772863355a0cf57a49e93608790dfd17c8fd82da. Pick-to: 6.10 6.8 6.5 Coverity-Id: 896868 Coverity-Id: 896870 Change-Id: I146a588e4b2ef5bb6053274479ad96bcbdf75c11 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: fix weird variable assignment in initScripts() loopMarc Mutz2025-10-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code updated the `eor` variable in the third field of the for loop, after the increment of the loop variable, `i`, to the then-value of `i`. The variable was initialized as zero. This is a very roundabout way of doing things, because, if you look at it from the right angle, `eor` will always have the value 'i' has when entering the loop body. Proof: - First round: i = 0, eor = 0. So i == eor. Check. - Next round: i = 1 + whatever value `i` had at the end of the previous iteration. eor := i, so i == eor. Check. So rewrite the code to create `eor` at the beginning of the loop body, with the then-value of 'i'. This allows marking it const, too, and scoping it correctly, drastically improving readability. The tighter scoping runs afoul of the assert(eor == string.size()) after the loop, which, however, is pointless, because it's true by construction: the loop has no break statement, so the only way it can be exited is by failing the loop condition. At that point, eor := i and i == string.size(), so eor == string.size(). Partially reverts 3df159ba174c1775a0e77d2305a639eeab1ea71d, but the loose scope of the variable was present even before that. Pick-to: 6.10 6.8 6.5 Change-Id: I983aef94caa8a3bc09ab378b8bb9bb4a18dabeb4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: improve variable allocation in getSentenceBreaks()Marc Mutz2025-10-271-4/+4
| | | | | | | | | | | | | | | Make 'pos' and 'prop' const, indicating that they're not modified by the lengthy loop body, and don't re-use 'ucs4' and 'prop' from the outer loop, make the inner loop have their own versions. This shadows the outer loop ones, but -Wshadow is not in effect in implementation files. I found it more important to avoid churn than to rename the variables to avoid the shadowing. Shadowing is well-defined in C++. These are in preparation of porting the function to QStringIterator. Pick-to: 6.10 6.8 6.5 Change-Id: Ia8b136c2cf4c8bc70d7444456adae93aecf6138b Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QUnicodeTools: improve variable allocation in getWordBreaks()Marc Mutz2025-10-271-4/+4
| | | | | | | | | | | | | | | Make 'pos' and 'prop' const, indicating that they're not modified by the lengthy loop body, and don't re-use 'ucs4' and 'prop' from the outer loop, make the inner loop have their own versions. This shadows the outer loop ones, but -Wshadow is not in effect in implementation files. I found it more important to avoid churn than to rename the variables to avoid the shadowing. Shadowing is well-defined in C++. These are in preparation of porting the function to QStringIterator. Pick-to: 6.10 6.8 6.5 Change-Id: I2b0c135276ccef403802dba8b780dcbf8c0ed519 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QStringIterator: add nextOrRawCodeUnit()Marc Mutz2025-10-271-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While fixing Clang 21 -Wcharacter-conversion warnings, I came across many code snippets that used a pattern like char32_t ucs4 = string[i]; if (QChar::isHighSurrogate(ucs4) && i + 1 != len) { ushort low = string[i + 1]; if (QChar::isLowSurrogate(low)) { ucs4 = QChar::surrogateToUcs4(ucs4, low); ++i; } } (this one from qunicodetools.cpp) The natural question is why this was never ported to QStringIterator, and the answer is: because QStringIterator doesn't support this. Add new functions nextOrRawCodeUnit() (and previousOrRawCodeUnit()), to fix this shortcoming. The name of the functions is chosen so that it will work also in a future UTF-8 string iterator. Add tests that verify that the old code and the new functions produce the same series of code points. Pick-to: 6.10 6.8 6.5 Change-Id: I34ba8e416ee290badc1c16e33b46a17d56741574 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QBasicAtomicInteger: Add (internal) refRelaxedFabian Kosmale2025-10-274-1/+16
| | | | | | | | | | | | | | | | | | | | It is known that incrementing the refcount can use relaxed semantics, compare https://web.archive.org/web/20251016043603/https://devblogs.microsoft.com/oldnewthing/20251015-00/?p=111686 However, we can't modify QBasicAtomic::ref, because that is documented to use "ordered" semantics. So introduce a new (internal) refRelaxed method, which simply calls fetchAndAddRelaxed(1) instead. Compared to ref, we also do not return anything, as no expected user has a need for the return value (and it only causes more work for the compiler to get rid of it again). Our deref operation is still using acquire_release semantics, so everything is fine. Port QArrayData to use it as a first user so that the functionality is tested. Change-Id: I678870551fe85b83d9bb073ddb5947e649845264 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QUnicodeTools: prefer lineBreakClass() convenience functionMarc Mutz2025-10-271-4/+2
| | | | | | | | | | | | | | | | ... where applicable Simplifies the code. In some cases, the code queries more than one property of the character, in which case we keep using qGetProp(). Amends 85899ff181984a1310cd1ad10cdb0824f1ca5118 and 1f73d4b87c153224b4eeee164269d0b313a11a8b. Pick-to: 6.10 6.8 6.5 Change-Id: I27cc0e5607b1e730f649c9d73f05f6b1227bdd17 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QByteArray: de-duplicate code by using QtMiscUtils::fromHex()Ahmad Samir2025-10-271-17/+7
| | | | | | | | | Pointed out by Thiago in code review. Drive by, tighten the scope of the local variables. Change-Id: Id12af76daac382495cb6abad6a6ecf35cdd1cbc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QByteArray: percentDecoded/fromPercentEncoding: add rvalue overloadsAhmad Samir2025-10-273-20/+50
| | | | | | | | | | | | | | For the rvalue overload the changes are done in-place unless the byte array is shared, in which case the changes are written to a new array to prevent detaching. One immediate beneficiary of this overload is qDecodeDataUrl(). [ChangeLog][QtCore][QByteArray] Added rvalue overloads of percentDecoded() and fromPercentEncoding(). Change-Id: I2aadfbf93f06a72460ec04692355f73a6c892e30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLatin1StringView: optimize single-char case-sensitive {last,}indexOfThiago Macieira2025-10-262-6/+25
| | | | | | | | We can delegate to QByteArrayView, which now has inline versions of those two functions, so long as the input is Latin1. Change-Id: Ica7a43f6147b49c187ccfffd179eb0f3748164b2 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Document Q_PRESUMEThiago Macieira2025-10-261-3/+16
| | | | | | | | | | [ChangeLog][QtCore] Added Q_PRESUME macro to wrap C++23 [[assume]] and thus never evaluates the expression, replacing Q_ASSUME which could evaluate it. Change-Id: I7895364ccac9ce36ea5afffd738f60d96839bfd9 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows11Style: fix QMenuBar highlightingChristian Ehrlicher2025-10-251-24/+25
| | | | | | | | | In pressed state the text color is subtlePressedColor, only for hover we have to use subtleHighlightColor. Pick-to: 6.10 Change-Id: I7ad7505a73df5ab8255210a237efcc0903b7b445 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWindows11Style: Fix menu item checkmark/icon paintingChristian Ehrlicher2025-10-252-94/+94
| | | | | | | | | | | The windows11/WinUI3 style draws, in contrast to windows/windowsvista the checkmark and the icon separately. Also fix the whole length calculation to match the WinUI3 style. Pick-to: 6.10 Fixes: QTBUG-139693 Change-Id: I96a6560b4e90c147aa53cb02381950ef75222afc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Windows11Style: adjust QPushButton geometryChristian Ehrlicher2025-10-251-63/+67
| | | | | | | | | | | | | Provide PM_ButtonMargin and PM_MenuButtonIndicator values for the windows11 style so the base style calculates the size correctly. Also don't try to calculate values for rtl - simply use visualRect() instead. Use QIcon::paint() instead trying to figure out the correct position and rect for the icon by ourself. Pick-to: 6.10 6.9 Fixes: QTBUG-140145 Change-Id: I2da9f67ae83ec0e57c4587363e75d66cfa6555e4 Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
* QSaveFile: merge the QString constructorsThiago Macieira2025-10-243-12/+10
| | | | | | | | Now that we don't need to keep the !QT_NO_QOBJECT code. Change-Id: Iad40e29375680befca7cfffdec7085a7f641c76f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QSaveFile: remove !QT_NO_QOBJECT supportThiago Macieira2025-10-242-15/+1
| | | | | | | | | | | Amends commit 670810787318df8a80b2197b49448c18a78bb7ed, which removed qsavefile.cpp from the bootstrap lib. Pick-to: 6.10 Change-Id: Iac520c557c978d6f9ec3fffd3dd83a18ca6a98df Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFileSystemEngine/Unix: work around copy_file_range() returning EINVALThiago Macieira2025-10-241-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Looks like Linux does return EINVAL with ecryptfs. I didn't know anyone still used it, because there had been discussions in 2023 that it was deprecated and going stale on its crypto. > Hi - I don't think an additional reviewer is going to be sufficient to > get eCryptfs into a good state long term. There are fairly large > design problems that need more attention. I'll send a patch to > deprecate and mark for removal in 2025. The 2025 removal hasn't happened, though the discussion has reoccurred[2] with the subject "ecryptfs is unmaintained and untested". I suppose people who installed systems when Ubuntu recommended it may still have such systems around. [1] https://lore.kernel.org/lkml/20230403134432.46726-1-frank.li@vivo.com/T/#ecc899c0c24fbcb7ad0ed78301cf812dd33cc594b [2] https://lore.kernel.org/lkml/Zx-ndBo7wpYSHWPK@casper.infradead.org/ Pick-to: 6.10 6.8 Fixes: QTBUG-141371 Change-Id: I7a04c783b344e774d253fffd26474ffc012583c8 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Fix off-by-one in QUnicodeTools::getWhiteSpaces()Marc Mutz2025-10-241-1/+2
| | | | | | | | | | | | | | | | | | There are no space characters in Unicode outside the BMP at the moment (QUnicodeTables::MaxSeparatorCodepoint == 0x3000 at this point), but if there were, the old code would flip the QCharAttributes::whiteSpace on the low-surrogate position, not the high one, as all other functions do. Fix by using the same pattern used by the other boundary-finding functions: save the index at the start of the loop, and use the saved value when indexing into attributes[]. Amends 824180a12249e48c0e3280fec64940825ce0aa6e. Pick-to: 6.10 6.8 6.5 Change-Id: I116a5e1da6c9df5e4237073481d71efbf956f27f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* gui/rhi,vulkan: use VK_COLOR_SPACE_PASS_THROUGH_EXT on WaylandXaver Hugl2025-10-242-0/+25
| | | | | | | | | | | | On Wayland, only one color management surface can be created at a time without triggering a protocol error, and we create one ourselves in some situations. To avoid this problem, use VK_COLOR_SPACE_PASS_THROUGH_EXT when supported, so that the driver doesn't create a color management surface as well. Change-Id: Ie93ea02f1a8c2205a948f680cc3c985ccee4b057 Pick-to: 6.10 Reviewed-by: David Redondo <qt@david-redondo.de> Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
* Add macOS backend for QRandomAccessAsyncFileIvan Solovev2025-10-244-16/+839
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The backend uses Grand Central Dispatch to perform async IO. One complication is that the GCD APIs do not allow to cancel a signle IO read/write operation, instead it's only possilbe to close the related IO channel. Luckily, it's possible to have multiple IO channels referencing the same file descriptor. As a result, we end up duplicating IO channels for each async operation, which makes the code a bit more complicated. The implementation uses QWaitCondition to make sure that the async operation is completed or canceled before removing the relevant QIOOperation or QRandomAcessAsyncFile instance. Another tricky part was the implementation of flush(). The docs for dispatch_io_barrier claim that it applies to a file descriptor, not a specific channel, and thus acts as a barrier across all channels that share the same file descriptor. However, in practice it does not work! As a result, the patch implements an operation queue, and schedules the barrier operations only when all previous operations are completed. Similarly, no new operations are scheduled until the barrier operation is completed. The same logic is applied to the async open() operations that are also considered to be barrier operations. Fixes: QTBUG-139005 Change-Id: Iac448d9460c64dd18dc3b15fc13d5145895a3c3b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Update screenshots in the "Qt Widgets Designer Integration" articleAlexei Cazacov2025-10-247-7/+6
| | | | | | | Fixes: QTBUG-140881 Pick-to: 6.10 Change-Id: I1555bff58943cdf09bb7115550c5b2683b1cade1 Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* Remove unused header from qnetworkinformation.cppMate Barany2025-10-241-1/+0
| | | | | | | Pick-to: 6.10 Change-Id: If5239161254da7e7a9d6c6a6ce2d724841fec330 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostAddress: clear() the scopeId tooThiago Macieira2025-10-232-8/+7
| | | | | | | | | | | | Looks like this was forgotten since time immemorial. And not a lot called QHostAddress::clear(), so we never noticed; it was definitely not tested. Drive-by move it to the header to make it inline. Pick-to: 6.10 6.8 6.5 Change-Id: I2cdc8cf3cbbcb17ecc5ffffdb4257ce269813971 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QTimeZone: remove remnant of QSharedDataPointer<QTimeZonePrivate>Thiago Macieira2025-10-232-8/+0
| | | | | | | | | | | | | | | Amends commit ae6186c7e8cfdb9420b9119f5affbba7d069598d, which replaced the implicit d-pointer using QSharedDataPointer of the original Qt 5.2 design with an explicit implementation, with support for a "short object" of just an offset. There's a QExplicitlySharedDataPointer<QTimeZonePrivate> in qtimezone.cpp, which currently doesn't detach at all. If and when it does, reimplementing this may be needed. Pick-to: 6.10 6.8 Change-Id: I92b4b30f60689d0a1f5ffffd53f6f71cd1834f15 Reviewed-by: Edward Welbourne <edward.welbourne@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>
* QList::assign: optimize for empty std::initializer_listThiago Macieira2025-10-231-1/+6
| | | | | | | | | | | | | Happens often when one writes: l = {}; For the vast majority of cases, the size is a constant because the std::initializer_list is an automatic variable, so this should not result in extra conditionals in the code (in release mode, of course). Pick-to: 6.10 6.8 6.5 Change-Id: If90fc920810f42ab68e5fffdc7a254b2e3f709a7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QList: call the two-arg qHash() functionThiago Macieira2025-10-231-2/+2
| | | | | | | | | | The single-arg one is deprecated. Let's stop using them in tests. Drive-by test that hashes work for zero and non-zero seeds. Pick-to: 6.10 6.8 6.5 Change-Id: I5b32acf0797e9e62a5b7fffd1bc44f5372a044cf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Docs: Fix QAndroidNativeInterface doc bugNicholas Bennett2025-10-231-2/+3
| | | | | | | | | | | Replaced QJniObject with QtJniTypes::Context Fixes: QTBUG-140208 Pick-to: 6.10 6.8 Change-Id: Id9567ae4b26a457bf8dc614fb29b64ed27b4063e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Andrey Filipenkov <decapitator@ukr.net>
* QAbstractItemView: Fix using declaration of update()Friedemann Kleint2025-10-231-1/+1
| | | | | | | | | | It is a QWidget method. PySide's shiboken6 code generator is a bit picky about the using declarations. Pick-to: 6.10 Fixes: PYSIDE-3219 Change-Id: Iafb2c2d8c0d66a38f6b48eef9a09f94f4fc25141 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Revert "Set QGuiApplicationPrivate::lastCursorPosition on Enter event"Shawn Rutledge2025-10-231-1/+0
| | | | | | | | | | | | | We probably still need to do this, but it seems to be somehow causing hover to be mishandled as press in some Qt Quick Controls autotests. This reverts commits 15a0a46d089477407a7ebfb46a952fb6f7548d3d and 24f40915a70ab7424806e842f8aeb3645fcd19e1. Task-number: QTBUG-141387 Task-number: QTBUG-141427 Change-Id: I1dc24a362cf1f93cc57ef4c8b6985abb000fa7ef Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Map function keys by their virtual key code, not MacRoman charsTor Arne Vestbø2025-10-231-85/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mapping incoming key events to their possible key combinations for shortcut mapping we use UCKeyTranslate, or its modern Cocoa equivalent [NSEvent charactersByApplyingModifiers:] (which plumbs to UCKeyTranslate internally). When doing so for function keys, we get back characters codes such as 0x01 / ␁ / Start of Heading when pressing the Home key, or 0x04 / ␄ / End of Transmission when pressing the End key, which map to kHomeCharCode and kEndCharCode correspondingly in the MacRoman character codes table from HIToolBox's Events.h We used these MacRoman character code mappings to turn kHomeCharCode into Qt::Key_Home and kEndCharCode into Qt::Key_End. Surprisingly UCKeyTranslate/charactersByApplyingModifiers does not return the equivalent function key character codes from the NSEvent.h header, such as NSEndFunctionKey, even if the original NSEvent we're processing has this as the NSEvent.characters or NSEvent.charactersIgnoringModifiers, as reported here: https://developer.apple.com/forums/thread/803439 This is a problem because key events with the Control (^) key also (naturally) map to these character codes when fed through UCKeyTranslate, which resulted in matching shortcuts for Qt::Key_Home and Qt::Key_End if the user pressed Control+A or Control+D. Or even worse, if users had shortcuts registered for Ctrl+A and Home, or Ctrl+D and End, at the same time, these shortcuts would be considered ambiguous. To fix this we now map function keys via the keyboard layout independent virtual key codes from the same HIToolBox Events.h header, which ensures we only map real function keys during to Qt::Keys such as Qt::Key_End. Note that we still consider the keyboard-layout-mapped character codes for functions keys coming from NSEvent.h, in case there are layouts that explicitly map to these. Fixes: QTBUG-134441 Pick-to: 6.10 6.8 Change-Id: Iac8def7540247665562b438bf4af06b4347d33b0 Reviewed-by: Doris Verria <doris.verria@qt.io>
* Testlib: batched tests - allow the registration of stateful functionsTim Blechmann2025-10-232-2/+2
| | | | | | | | | `qRegisterTestCase` only took a function pointer as argument. We change the signature to take a std::function object of the same signature. This will allow us to bind arguments to a callable object. Change-Id: I8c082ec5d11becbeae83344fadb10f4e6391a2d1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows11: Don't force highlightedText to be windowText in high contrastOliver Eftevaag2025-10-231-3/+0
| | | | | | | | | | | | | The style would overwrite the highlightedText color to be equal to the windowText for the active group. This would negatively impact styles in Qt Quick, whenever a QApplication was being used. The highlightedText color would not be correct. Task-number: QTBUG-140507 Pick-to: 6.10 Change-Id: I282971a4556d0b10d9e32af3514aa6f51800e35e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
* Fix nullptr deref in QMenu::mouseReleaseEvent()Axel Spoerl2025-10-221-1/+1
| | | | | | | | | | 879eb2c08094a70683488d56520efd3a4cf1b086 introduced a nulltr deref. Amend the patch to fix it. Coverity-Id: 896788 Pick-to: 6.10 Change-Id: Ic05db9f5bfb67ece01a0e030400697d97712646e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* wasm: Set input field size to 1x1Even Oscar Andersen2025-10-221-2/+2
| | | | | | | | | | It seems, for 6.10.x, the size of the input field affects the user interface. Set to 1x1 to minimize the effect. Fixes: QTBUG-141054 Pick-to: 6.10 Change-Id: Id9cc0a84d7cf2f700c4df2155210569b1372e19f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Update and expand Apple icon engine mappingsTor Arne Vestbø2025-10-221-93/+95
| | | | | | | | | Fixes: QTBUG-139964 Pick-to: 6.10 6.8 Done-with: Geoff Hutchison <geoff.hutchison@gmail.com> Change-Id: I842e4be557de667fd3c1c244f4ff1caf2af482f2 Reviewed-by: Karolina Sofia Bang <karolina.bang@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* iOS: Guard QIOSDocumentPickerController outliving QIOSFileDialogTor Arne Vestbø2025-10-221-1/+12
| | | | | | | | | | | The document picker may outlive the QIOSFileDialog even if we've released it, if the system has retained it, and we might get delayed callbacks to e.g. documentPicker:didPickDocumentsAtURLs, in which case we'd crash. Pick-to: 6.10 6.8 6.5 Change-Id: Idc9f2f6d297332b91d25dc768d1defaf5bde8076 Reviewed-by: Doris Verria <doris.verria@qt.io>
* macOS: Only set nameFieldStringValue for NSSavePanelTor Arne Vestbø2025-10-221-1/+2
| | | | | | | | | | | Even though NSOpenPanel is a subclass of NSSavePanel, it emits a warning when the property is set: Ignoring NSSavePanel method sent to NSOpenPanel: setNameFieldStringValue: Pick-to: 6.10 Change-Id: I9886f861797bab92a89cdaa361c0e6d8802053ee Reviewed-by: Doris Verria <doris.verria@qt.io>
* Disable {position,resize}Automatic on first exposeTor Arne Vestbø2025-10-222-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Disabling automatic positioning/resize after platform window creation assumed that the platform window could synchronously determine the automatic position/size, either via QPlatformWindow::initialGeometry(), or via platform APIs. But for platforms like XCB, the automatic position is determined by the window manager when the window is first mapped. With the existing logic, we would end up overriding the position when QWidget would set size hints or resize the platform window during setVisible. We now defer the reset of {position,resize}Automatic until the expose event. Ideally we should do it only when the window is first shown, but we don't have a QWSI for tracking window visible-state. Amends 59d77a0162d92a9993b7bb4c593e88cbb8f8d9c8. Fixes: QTBUG-141099 Pick-to: 6.10 Change-Id: I53a0205c7fbddf922b030b3f4bd9b6ce5c4915b9 Reviewed-by: Liang Qi <liang.qi@qt.io>
* macdeployqt: fix variable typo & scopeMoss Heim2025-10-222-5/+4
| | | | | | | | | | | Identiy->Identity Variable is not used in shared.cpp so can be made local in macdeployqt main. Pick-to: 6.10 Change-Id: I8893ea0570f41691972116ab0733580176a7b2ba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Remove references to Qt 4 booksAlexei Cazacov2025-10-221-274/+3
| | | | | | | Fixes: QTBUG-140879 Pick-to: 6.10 Change-Id: Ia51db21a6922393affbd11f1749f64f49c0f8702 Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* QPainterPath: Avoid division by zero in *AtPercentRobert Löhning2025-10-221-0/+11
| | | | | | | | | Without the added checks, the code divided by the paths' lengths which are zero. Pick-to: 6.10 6.8 Change-Id: I78a2066af96136635f85f4937619ff398a28072c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QStyleSheetStyle: don't draw SC_SliderGroove when not asked forChristian Ehrlicher2025-10-221-18/+17
| | | | | | | | | | The rules for QSlider: add/sub-page where drawn even though SC_SliderGroove was not given. Pick-to: 6.10 Fixes: QTBUG-141157 Change-Id: Ibdb22e18588c54f0f59be37fd6a430e74e0df762 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Windows11Style: fix drawing disabled, checked QRadioButtonChristian Ehrlicher2025-10-221-3/+1
| | | | | | | | | | | A disabled, checked QRadioButton is not drawn as checked. This was introduced with a39047eeb6202a3c081d2441be9dc4f3d017fb97 Pick-to: 6.10 Task-number: QTBUG-139605 Fixes: QTBUG-140449 Change-Id: I2c34637b0ef51d619a81a78862021a76ae5b20a0 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QNativeSocketEngine/Unix: detect sockaddr_dl with AF_LINKThiago Macieira2025-10-211-3/+3
| | | | | | | | | | | | Instead of by proxy trying to guess that BSD systems have it and others don't. That's an incorrect assumption because QNX has this and IP_RECVIF, but isn't marked a Q_OS_BSD4. FreeBSD says sockaddr_dl should have .sdl_family = AF_LINK: http://fxr.watson.org/fxr/source/net/if_dl.h Change-Id: Ibe2777515c0f71285783fffd5c0094f622de34a9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>