summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA: Add missing refresh rate updateMorteza Jamshidi2025-10-291-0/+5
| | | | | | | | | Added missing handleScreenRefreshRateChange call to QWindowsScreen Fixes: QTBUG-139966 Change-Id: If34ea49b61db1e6ec8b0af92517aee42480c4ce8 Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Fix typo in lidbus-1 headers third-party nameKai Köhne2025-10-291-1/+1
| | | | | | Pick-to: 6.5 6.8 6.10 Change-Id: I885b40062214aedbf367f2298eb346c594e1a297 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SHA3: Replace git SHA with tagKai Köhne2025-10-291-1/+1
| | | | | | | | | | [ChangeLog][Third-Party Code] Replaced version information of 'Secure Hash Algorithm SHA-3' from a git SHA to a semantic version. The content remained the same though. Pick-to: 6.5 6.8 6.10 Change-Id: Ic05b0746eb78491fe9abdfea4d09092d4181a647 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Fix double emission of certain a11y eventsTimon Sassor2025-10-281-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 3c709198838866d5122c69a30cacdc806605d0cf and e7a211d702d6aa21a30eff56ceeffc153385443e introduced a11y actions for focusing and scrolling. However they also accidentally introduced a double emission of their according events. This causes problems, since every new event stops the processing and announcement of the previous in TalkBack. We remove the sendEventForVirtualViewId() calls from performAction() and performActionForVirtualViewId(), because they are the culprit. If an action like focus or scroll changes the app state, an a11y update is triggered, which ends up calling notifyObjectFocus() or notifyScrolledEvent() where the according event is then emitted and the a11y delegate state is updated. For the focus there is an exception, since an element cannot gain the active focus if is is disabled. However TalkBack should still be able to place its focus frame on that element and read out its content. Pick-to: 6.10 6.8 Change-Id: I9061eec713fd5382feb7aacafdffe393968ef8f1 Reviewed-by: Lars Schmertmann <SmallLars@t-online.de> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Narrow eccentric usage of QLocale::FormatType to one compilation unitEdward Welbourne2025-10-284-7/+6
| | | | | | | | | | | | | | | | | In qtimezonelocale.cpp some functions use QLocale::FormatType with a locally-defined eccentric meaning. I'd made the mistake of letting that infect a QTimeZonePrivate method's signature, even though its callers only ever passed NarrowFormat and its name said it was for narrow usage. I managed thereby to mislead myself as to what it would do for other format types. Instead, drop this parameter, pass NarrowFormat to an internal helper of the implementation where the argument was previously passed, and save the two callers and the stub implementation from carrying a misleading distraction. Amends commit d13e9a1ae53ee53c4929bc88d578a02eec4b2dc4 Change-Id: I819a87a1b04f6509adffc66bd2c81150667b208a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUnicodeTools: port initScripts() to QStringIteratorMarc Mutz2025-10-281-10/+4
| | | | | | | | | | | | After fixing the roundabout way of updating 'eor' in a previous commit, this is now trivial (no nested loop). Amends c20422af13fb30751eaa58e8755c7a9a7fd20a50. Pick-to: 6.10 6.8 6.5 Change-Id: Idbbfc503f4bf3878d1fc57729224c99973bddc32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: don't look up surrogate line-break propertiesMarc Mutz2025-10-281-6/+12
| | | | | | | | | | | | | | We know they're SG, so don't go through the properties trie, hard-code the result. As a defense against changes, add checks to the generator and tst_QUnicodeTools. This is in preparation of porting getLineBreaks() to QStringIterator. Pick-to: 6.10 6.8 6.5 Change-Id: Ib3567398ba56f7ad3ce6fbca81f6b0f40379ee7d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QUnicodeTools: port some functions to QStringIteratorMarc Mutz2025-10-281-22/+9
| | | | | | | | | | | | | | | | (those which don't have nested loops due to the need for look-ahead). Use QStringIterator's new nextOrRawCodeUnit() to replace a Clang-21-Wcharacter-conversion-prone pattern of parsing a UTF-16 string. Amends cbfdec66033d14020d3e8a49bacc0d12d2b6798e (getGraphemeBreaks(); though that commit merely moved the code there from Harfbuzz) and 824180a12249e48c0e3280fec64940825ce0aa6e (getWhiteSpaces()). Pick-to: 6.10 6.8 6.5 Change-Id: I26b64fca6a26bb7ea4ab8ad14ba590213e949190 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* a11y: Report QAbstractSlider orientationMichael Weghorn2025-10-282-0/+20
| | | | | | | | | | | | | | | | Support QAccessible::Attribute::Orientation newly introduced in a previous commit in QAccessibleAbstractSlider, the accessible implementation for QAbstractSlider. This e.g. makes the orientation available for QScrollBar. Extend an existing QScrollbar accessibility test accordingly. Fixes: QTBUG-140769 Change-Id: I8ac32116ed175b3b6760e5d1577e78180849e0e7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
* a11y: Introduce accessible attribute for orientationMichael Weghorn2025-10-283-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce QAccessible::Attribute::Orientation to allow reporting an explicit orientation for an object. Drop the comments about horizontal and vertical for QAccessible::State. This no longer needs any consideration on whether or not to introduce such states, as it is implemented as an attribute now (that can indicate either horizontal or vertical orientation, instead of having two separate states). Allowing to explicitly set an orientation is for example helpful for scroll bars, so assistive technology users know what orientation those have, and what keyboard shortcuts apply (e.g. up/down keys to change the scrollbar position for a vertical scroll bar, left/right keys to change the position of a horizontal one). Corresponding states/attributes/properties exist in multiple platform a11y APIs: * Linux/AT-SPI2: states ATSPI_STATE_HORIZONTAL [1] and ATSPI_STATE_VERTICAL [2] * Windows/UIA: UIA_OrientationPropertyId [3] * macOS: NSAccessibilityOrientation [4] * web/ARIA: "aria-orientation" property [5] Initially, handle the new attribute in the AT-SPI2 adapter for Linux. Handling for more platform a11y bridges and using the new states to report the QAbstractSlider orientation will be implemented in separate upcoming commits. [1] https://gnome.pages.gitlab.gnome.org/at-spi2-core/libatspi/enum.StateType.html#horizontal [2] https://gnome.pages.gitlab.gnome.org/at-spi2-core/libatspi/enum.StateType.html#vertical [3] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids [4] https://developer.apple.com/documentation/appkit/nsaccessibilityorientation [5] https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-orientation [ChangeLog][QtGui][QAccessible::Attribute] Added new Orientation enum value that can be used to specify the orientation of an accessible object. Task-number: QTBUG-140769 Change-Id: I87ac29447622189561fa7f25947cfd7f6b028056 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
* QSaveFile: add std::filesystem::path supportThiago Macieira2025-10-282-0/+34
| | | | | | | Fixes: QTBUG-141433 Change-Id: I8fbc9a78026237e0e823fffd1760cff3adf0bd40 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QTest: include <chrono> instead of relying on transitive includesAhmad Samir2025-10-281-0/+1
| | | | | | | | Found in code review. Pick-to: 6.10 6.8 6.5 Change-Id: I111907d6b365ea642c44dff6caed65192124dff9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFile: move the std::filesystem supporting content to qfiledevice.hThiago Macieira2025-10-282-28/+33
| | | | | | | | So this can be used for QSaveFile. Change-Id: I9a5e12778acffe3382e1fffdad99da8ba440ad76 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Windows11Style: don't crop checkbox with no textChristian Ehrlicher2025-10-281-9/+29
| | | | | | | | | | | | | The size calculation for a checkbox with no additional text/icon did not match the drawing code. There are still some values to settle but the logic is now correct even the spacing might change in the future to match the WinUI3 style spacings. Pick-to: 6.10 Fixes: QTBUG-135628 Change-Id: I37e44fe8ad4f377ad346e55aac9854f4da6fc222 Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
* 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>