summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QSqlDatabase: make evident the name of the driver that failed to load6.8Thiago Macieira2025-04-181-3/+3
| | | | | | | | | | | | | | | | Tell me this isn't confusing: Got keys from plugin meta data ("QMYSQL3", "QMYSQL", "QMARIADB") QSqlDatabase: driver not loaded QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3 This also merges the two messages into a single line, which is nicer for rich logging environments. Change-Id: Ieb80c6571213dddc518bfffdb6c86632df8f932c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 4216ba7c37dbdf67bfb5dc793d01a232ce4ea762) (cherry picked from commit 22dd10e261c1c9ab46a8bfe99f574bae1c6c01e9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMainWindowLayout: de-pessimize ~QMainWindowToolBarMarc Mutz2025-04-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | As the code comment says, ~QMainWindowTabBar will removeOne(this) from QMainWindowLayout::unusedTabBars. It doesn't assert that it was included in it, or something special like that. So we can optimize the whole thing by making sure that ~QMainWindowTabBar doesn't find anything to remove here, avoiding a detach from the copy 'bars' and potentially also avoiding quadratic behavior, as we delete the items in order. Found by Coverity, but it only saw this as an optimization opportunity because it doesn't understand that the copy is needed. Amends 23357e59bb4dc54e76a237b290aa64a620db2ea1. Pick-to: 6.5 Coverity-Id: 479705 Change-Id: I6c31e028c0c39813768e8c71076471b39bd8ef5a Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit fb7670f193712fae2d4c03d6ee2a6c30101b886f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit df8f7becfc38ad6441a7f409525c2becc1e3bf93)
* Avoid using the $<CONFIG> based directory in .rc pathsAlexey Edelev2025-04-181-3/+4
| | | | | | | | | | | | | | The use of '/$<CONFIG>/' component in .rc path leads to undefined behavior caused by CMake internal conflicts. Replace the path component with the filename suffix. Fixes: QTBUG-136019 Pick-to: 6.5 Change-Id: I73ae7f89ac65d00661148fcf41c973945bd2cc4f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7ce4a8a8c977688144efb94d41e20ed2420aa74b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 4ea5f55aed0b66d266d9efa895d7bc8fe6d59f5f)
* qcompare.h: standardize on Coverity-friendly ctorsMarc Mutz2025-04-181-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity complained that the Qt::strong_ordering(std::strong_ordering) ctor may leave m_order uninitialized, which is true if you assume that 'stdorder' could be anything else but {less, greater, equal}, which, however, should not happen™. Standardize on the pattern that QPartialOrdering(Qt::partial_ordering) was using: init m_order to equivalent, and then check for the other possible states. I would have preferred adding 'else Q_UNREACHABLE()', but these are constexpr functions, so we'd need the GCC 8 protection, and then the else would have a body longer than one line, and I don't know whether violating the coding style and adding {} only on the else would fly with reviewers, so that's done in a follow-up. Amends several changes (this code has seen a lot of churn over time). Coverity-Id: 475148 Change-Id: I3d88cdaaffbdfb8720161470b5f89046a3a15088 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f6d878d5ce4d6e41c088698bd337cf7f4438433e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit da619f9e0b855d1c4b72820ed304ae8229f76829)
* QHeaderView: fix more UB (signed integer overflow) in setOffset()Marc Mutz2025-04-181-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We fixed the first line of defense in 03d1e81516be9af37fa08900f9a2d88d34abc4df, but that commit didn't rule out ndelta == INT_MIN, in which case -ndelta overflows a few lines below. Coverity pointed this out. Add a check that exposes this problem to ubsan, and avoid the overflow by using qMulOverflow<-1>()¹ and not scrolling when it overflows, but emitting a qWarning(). ¹ There's no qNegateOverflow()... When state == QHeaderViewPrivate::ResizeSection, we assume that everything happens on the actual screen, which has physical limits to the setOffset() argument, and therefore these arithmetic operations don't need to be protected. I fully expect that this will just be a rat's tail, one we can only hope to control by using Peppe's safe integers everywhere, at which point we've probably blown our executable code size out of any proportions. So leave it at this, for the time being. Amends 03d1e81516be9af37fa08900f9a2d88d34abc4df. Coverity-Id: 479557 Pick-to: 6.5 Change-Id: I2e31fc9be21e7d59563b67f3cd26c29dcea61b55 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 49fcac99deea390901000a74deea1c0c690b6ae2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f98c49666a518df3ac182e1f4920b581d1a6bda7)
* QAbstractSlider: fix missing "emission" of SliderOrientationChangeMarc Mutz2025-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractSlider::sliderChange() is not a signal, but a protected function, carrying an enum (also protected) to inform subclasses about changes in the base class. A user reported (QTBUG-135597) that in 5.15 the function was not called for SliderOrientationChange. A prior test addition confirmed that this bug is in all active branches. Add the missing call in setOrientation(). This _should_ replace the update() call, because the default sliderChange() implementation already calls it (and setPageStep(), e.g., relies on this behavior), but since SliderOrientationChange was not emitted since Qt 5.0, I minimize regression risks and keep the update() call, just in case a user wrote code where they forgot to call Base::sliderChange() for SliderOrientationChange (and this never showed because we never "emitted" that, up to now). The duplicate update() calls will be merged by Qt's event loop, so are harmless. A dev-only follow-up change will remove the update(). [ChangeLog][QtWidgets][QAbstractSlider] Fixed the missing "emission" of protected sliderChange(SliderOrientationChange). Amends the start of the public history. Pick-to: 6.5 5.15 Fixes: QTBUG-135597 Change-Id: I4545d47d315a98a9a51134901a00fa369f720754 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit c35f6851bfe8ba71c26d3896498c1510fcd4e42b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 4b20e23ed7a7c32b6557e526bf88804c48ac8325)
* gtk3theme: Honor gtk-cursor-blink for whether blinking is onKai Uwe Broulik2025-04-171-1/+5
| | | | | | | | | | | gtk-cursor-blink-time is in an interval 100..2500ms, GTK uses a dedicated boolean to determine whether blinking is on in the first place. Change-Id: I8a5dff70b6b3fbeeab599cf50402532052afe8b7 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit e2035be13d4d834fb179b7228e176ff5d4aa1721) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 9909c896770c844004f14e520db6122ddc2f48a7)
* Make F11 the fullscreen keyboard shortcut on Gnome (as on KDE & Windows)Shawn Rutledge2025-04-171-2/+1
| | | | | | | | | | | | | | | | This seems to agree with current Gnome documentation. [ChangeLog][Platform Specific Changes][Linux] The fullscreen keyboard shortcut is now F11 on Gnome, not Ctrl-F11. Pick-to: 6.5 Fixes: QTBUG-135854 Change-Id: I8ee0bd34152ce8ef112fd3226d17adc89f2a408e Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 30fd101b558112b8829d3ae63b58e8504bbe9297) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 4f89fbc9a9e6a83c02e7e425a206db4e105df6aa)
* QMenu: show when QWidget::childrenRect is not emptyVolker Hilsheimer2025-04-171-2/+4
| | | | | | | | | | | | | | | | | | | Amends 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383 after which QMenu::popup returned early and without showing the menu if none of the actions had a valid geometry in the menu. This broke use cases where QMenu was used as a regular container widget with child widgets (possibly in a layout). To fix this, take the result of QWidget::childrenRect() into account, and only return early if that rect is also empty. Task-number: QTBUG-129108 Fixes: QTBUG-135933 Change-Id: I05977044411df236146bb81dc08a30c176dfb6cb Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 7ffa6f1dd5c47196ac05300bd990b673c7cca976) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c78963023a4a200a298489648a4e6019400c073c)
* Widget effects DRY: replace manual pointer handling with unique_ptrVolker Hilsheimer2025-04-171-18/+18
| | | | | | | | | | | | | | | | | Instead of repeatedly resetting of the static pointers after (or before) calling deleteLater(), use a unique_ptr with a custom deleter. Since we use deleteLater(), nothing will happen if one of those widgets does leak to the point where static objects are destroyed; we'd at most call deleteLater() at this point, which won't do anything (if we enqueue a DeferredDelete event at all, then it will never be processed). Task-number: QTBUG-135976 Change-Id: I36a4780093eafd064dcb1a72696c1d9b21483b77 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit b50a2761e735208eeb62042ecfaba7a76e580454) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c9ba8760deec4b2f5c245e9120d59b622b383ceb)
* Silence code checker warning about unused std::unique_ptr::releaseVolker Hilsheimer2025-04-161-1/+1
| | | | | | | | | | | | | | | | We don't need the pointer, as it's the same as "this", we just don't want the event to own the object anymore. Nevertheless, silence code checker warning about the unused return. Amends 96ef0004111b47cec239846b169942bbc885c181. Change-Id: I6a3c73e971f1b9e10f5754018a1fa5941dca6172 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 920a490d659836785f03d51edc11da1711ade965) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bc2f4ace0ea4d98847218a9e2d2633efeccd28e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTimer: delete pending single shot timers when receiver's thread diesVolker Hilsheimer2025-04-162-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSingleShotTimer instances are usually destroyed when they receive their QTimerEvent, and otherwise are children of the creating thread's event dispatcher so that they do get destroyed even if they never fired. However, if the receiver object lives in a different thread than the thread that started the timer, then we move the QSST instance to that thread to make sure that it starts in the right thread. We then reparented the QSST instance to nullptr (it can't continue to be a child of the creating thread's event dispatcher), and connected to QApp::aboutToQuit as a fall-back in case the timer never fires. This has two problems: if the timer never fires (e.g. because the receiver's thread stopped before the timeout), then we created a soft leak (until aboutToQuit). And since the QSST instance was moved to the receiver's thread, the connection to aboutToQuit() is always queued, and also never got processed if the thread was stopped before (especially since we connected to deleteLater(), which would require another event processing cycle). So in practice, we ended up with a hard leak. To fix this, we have to reparent the QSST instance to the event dispatcher of the receiver's thread. We can do that reliably once the receiver thread processes events. Simplify the code to replace a meta-call with a posted event to ourselves, receiving which starts the timer (or immediately fires timeout if it has taken long enough to get there). To avoid memory leaks in the unlikely case that this posted event never gets delivered (e.g. because the thread is shutting down already), give that event ownership of the QSST instance until the timer is started. This turns out to be leaking anyway on most platforms, which requires further investigation. To be able to reparent safely away from a parent in a different thread, clear the sendChildEvents flag first. Amends 87535e4e4337596066258e361143cb9906e89512. Conflict resolution in 6.8: adapt to usage of raw timer IDs, as 5e36b9e929bb62a96cfe8d16bcc23d6a45d8294b is only in 6.9 and later. Fixes: QTBUG-135636 Change-Id: I8188160d54cfb63cb1765c5de8a6c0728dabb7e5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 96ef0004111b47cec239846b169942bbc885c181) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit cb199ab2aabb57c2825a042ab398679f3804e940)
* QColorTransferGeneric: fix the BT.2100 PQ EOTFGiuseppe D'Angelo2025-04-161-6/+20
| | | | | | | | | | | | | | | | | | | | The PQ EOTF formula for BT.2100 [1][2] was incorrect. Fix it; while at it, rename the variables to match the symbols used in the original formula. The inverse EOTF was correct, but also rename the variables there (for the same reason). [1] https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en [2] https://en.wikipedia.org/wiki/Perceptual_quantizer#Technical_details Change-Id: I6ce3a609824bee82053a16b3ff3cfc7cb396ce8f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit a7ff4679facb9a44dff8b63a7e461ababa6aedfb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 35c18eba64b6220e36ea14d32b911342e9d0921c) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Put qxmlstreamreader code behind its feature-flagJuha Vuolle2025-04-161-1/+2
| | | | | | | | | | | | | | | | Missed feature guards from: - QXmlStreamReaderPrivate class declaration (Cherry-pick edit for 6.8: writeCurrentToken guards already existed) Fixes: QTBUG-135230 Change-Id: I78741bc75a6baa8bc86ec5ce7d34a4333d8bdad4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 90c90d50715b7e7501b0a2153122d576656b9e4d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 3e67c1241a1915effd96d9c5b2d797f7a5d7df2a) Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QStringConverter: widen nameForEncoding()'s contractMarc Mutz2025-04-162-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity apparently mixes bootstrap and non-bootstrap builds: it complains that Encoding::Latin1 indexes encodingInterfaces[] out-of-range (apparently taking the size of the latter from a bootstrapped and the value of the former from a non-bootstrap build). That should somehow be fixed in the Coverity configuration, but it highlighted the fact that we have a narrow-contract function in this security-critical class that can trivially have a wide contract, so widen the contract by returning nullptr for invalid Encoding values. Consequently, mark the function as noexcept. As a drive-by, mark it also as Q_DECL_PURE_FUNCTION. [ChangeLog][QtCore][QStringConverter] The nameForEncoding() function now returns nullptr for an invalid Encoding value. Before, such a call resulted in undefined behavior. Pick-to: 6.5 Coverity-Id: 480251 Change-Id: Ie1c5c9df6881147a1ff44fe549e50748b2f5b7da Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 48959f7e5b670396805d4d62a44dd4fefac91611) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 62f382f2711d3d48f63ce8f825dc3ac838c3f662)
* QPointer: fix data race on ExternalRefCountDataDavid Faure2025-04-161-1/+1
| | | | | | | | | | | | | | | The creation of the ExternalRefCountData was published with testAndSetOrdered() but the loadRelaxed() would only load the pointer value, not the effects of the constructor. Pick-to: 6.5 Fixes: QTBUG-135640 Change-Id: I3acbc51e763e8a291be3f7036e0d9cd3965a2ce8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 253f34082f526ff1ffd9eaefac73cc9aa616ab2a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit df454f51f884004c4e65386b690c565d60af3630)
* Convert QTextStream internals to char16_t QChar::unicode()Edward Welbourne2025-04-151-13/+13
| | | | | | | | | Change-Id: If11457fbc472b2bc2ff7b76f4456fc87dd0014e5 Reviewed-by: Rym Bouabid <rym.bouabid@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 908b814fcdf209d113951331cb274f9b0fc4a87a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f07a3e07d108650e3220d399f51f42fca086fd95)
* windeployqt: Deploy Qt dependencies of local non Qt dependenciesOliver Wolff2025-04-151-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch we ignored every non Qt dependency we encountered while scannig the binaries. That led to missing Qt dependencies for more complex setups. With this patch we also take "local non Qt dependencies" into consideration. One example would be: - A developer has a project that consists of an executable and a dll, where both are built/copied into the same folder before deployment - The dll has different/additional Qt dependencies The old approach just ignored these additional Qt dependencies. The new approach checks for these local dependencies and finds the dll in the same folder as the executable. In this case windeployqt will now also scan this dll (and other local dlls) for Qt dependencies and deploy these as well as their plugins. [ChangeLog][Tools][Windeployqt] windeployqt now takes local non Qt dependencies into consideration during deployment. Fixes: QTBUG-135079 Change-Id: Ia916dea78c6a5707ccecb61d996a0b7490215798 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 5ce44934b3cf07f4bfbf006bb4666cd481577c2c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 95f659aedab4c063d5bd3d8fdd10a9ca9c4f489d)
* [androidtestrunner] Add early return if AndroidManifest.xml is missingAlexey Edelev2025-04-151-0/+4
| | | | | | | | | | Helps to debug deployment issues. Change-Id: I15909b3ce9e680636e87ec8764bacbd75711e857 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 2c8872f3815853b3bdefde30f09acd4389933744) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c971288a041529d263870b1cbe8d121e35f064c4)
* Doc: Fix \fn signatures for QFlags equality operatorsTopi Reinio2025-04-151-8/+6
| | | | | | | | | | | | | | | | | | | These are hidden members, and visible under the QFlags class in the Clang AST - even though semantically they belong to the parent (global) scope. Adjust the \fn signatures accordingly and remove the \relates commands as unnecessary; QDoc recognizes the `friend` qualifier and marks the functions as related non-members of QFlags automatically. Pick-to: 6.5 Fixes: QTBUG-133923 Change-Id: Iaca74971bde8b313c573e75688bf57d3ff42b59d Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 39358791f0553b2efbe3ee181e54694c2b72a6b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 9520dc55a91c33632dfb92edd88d1b52efc39131)
* Port QTEXTSTREAM_DEBUG to modern QFlagsEdward Welbourne2025-04-151-4/+4
| | | | | | | | | | | | Its code was just casting to int, which no longer compiles. Call toInt() on the fiag first. Pick-to: 6.5 Change-Id: I74971f37841b44879cffdb480a173561798f8fa7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a9e2f5d0dc93bbc171b9c0d014f7b00c9e87a8f7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit dc3659f70fd1fdf945503dc9fefd92081797b951)
* QProcessTask: include what you useGiuseppe D'Angelo2025-04-151-0/+1
| | | | | | | | Change-Id: I62d02bf914effa2d86e43ea178e5007acf9935c4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 22e212b6855f0e351b3b6a5a22b108e0bb53b986) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 304e4e5cc409724cf932706a466ec9c80c5d4fe6)
* QTestLib: fix crashes when using qDebug()s from threads with -junitxmlDavid Faure2025-04-152-8/+17
| | | | | | | | | | | | | | | | | | Other test loggers just output things immediately, but the junit test logger appends messages to a vector, so this needs to be mutex-protected. In case of qDebug()s from long-running threads, we also need to protect creation/destruction of systemOutputElement and systemErrorElement -- and in case of qFatal(), currentTestCase. Pick-to: 6.5 Change-Id: If35055fc232276a778951ebbfeaccd185b04f46b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com> (cherry picked from commit b4d6892ba5a745c1836daf34c850d13ef61e7ae0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 120a987544dc4d3824b02016dc837850b1fc8aef)
* Return early if qt_mapFillRect will return empty QRectRobert Löhning2025-04-151-0/+4
| | | | | | | | | | | | | | | | | Credit to OSS-Fuzz, this fixes issue 406541912. When rendering the svg image from that report, an integer overflow happend while calculating a QRect which is empty anyway. To avoid that, return an empty, default constructed QRect instead of calculating further. Picking back to 6.5 which is the oldest maintained version which contains this function. Pick-to: 6.5 Change-Id: I1a0d1310c55f7be613a6292f36481ac7c7e5b56f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit d1b88f8b73c16e1ee362fa4cc853bcaadae0df6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7a8baa2583d8a1dea01c82bb00ab78bb27390776)
* Doc: Qt D-Bus: Add image alt textsTopi Reinio2025-04-151-1/+1
| | | | | | | | | | | | | To increase accessibility for the documentation, provide altenative descriptions for the images. Fixes: QTBUG-135116 Change-Id: Id2d97251af9af0d4222f0dc15aa5b8e266ca36f4 Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> (cherry picked from commit 8e36dcf4c861033f4675e37383c847b2ae03d23d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit f4c1d51cae258559a00d4e929af1a11b6d304059)
* QDockWidgetGroupWindow: Properly destroy gap items and separatorsAxel Spoerl2025-04-151-0/+1
| | | | | | | | | | | | | | | | | | | QDockWidgetGroupWindow::destroyIfSingleItemLeft() cleared the item list without checking for gap or separator items. When a QDockWidget was deleted during an active drag, these items were leaked. Call deleteAllLayoutItems() before clearing the item list. Amends e6d85cf28bc4f750b69c33b72c006b067ae1190f. Task-number: QTBUG-135442 Pick-to: 6.5 Change-Id: I94dffe162023c12bda1f801236ae4462229601b5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 12dfc8d5ed4756f15a9ce5252af80d3daa9fa074) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b7aae992470d3a9e7beb57e3bd66259bbed11a53)
* rhi: d3d12: Avoid 1 sec timeout when skipping presentLaszlo Agocs2025-04-152-2/+9
| | | | | | | | | | Follow the d3d11 change. Change-Id: I06ef9e64f37fba72c2ab6adc84ad9058f22ae1e4 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit d8fb42bb790f468ad1b5304b743dbff297582ddd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7cd1dbce12b56afb35989292c96893c594f713bf)
* Include "is known to ICU" check in QTimeZonePrivate::localeName()Edward Welbourne2025-04-153-15/+26
| | | | | | | | | | | | | | | As long noted in the QIcuTimeZonePrivate constructor, we can't trust ucal_open()'s non-null return to mean it actually recognised the ID we passed it. So break out the "is available" check to a function in the QtTimeZoneLocale namespace so the check can be shared with localeName() when compiled with ICU but some other backend. We were previously getting GMT as display name for zones unknown to ICU. Change-Id: I57d57f94d8db7df76f24193a8ef1b5c71b08b0fc Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit fc9a26ea3a0b76de8a437d6417af334a7a9dfde5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b50bbd42694b24012e242c9bea0d0b2d96b6c5af)
* QReadWriteLock: fix data race on the d_ptr membersDavid Faure2025-04-151-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Testcase: ./tst_qreadwritelock countingTest WARNING: ThreadSanitizer: data race (pid=356186) Read of size 1 at 0x7294000000f8 by thread T12: #0 contendedTryLockForRead qtbase/src/corelib/thread/qreadwritelock.cpp:230 (libQt6Core_tsan.so.6+0x6c3743) #1 QReadWriteLock::tryLockForRead(QDeadlineTimer) qtbase/src/corelib/thread/qreadwritelock.cpp:190 (libQt6Core_tsan.so.6+0x6c347b) #2 QReadWriteLock::lockForRead() qtbase/src/corelib/thread/qreadwritelock.h:68 (tst_qreadwritelock+0xb0f0) #3 ReadLockCountThread::run() qtbase/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp:597 (tst_qreadwritelock+0xc506) Previous write of size 8 at 0x7294000000f8 by thread T2: #0 operator new[](unsigned long, std::align_val_t) <null> (libtsan.so.2+0xa78eb) #1 allocate qtbase/src/corelib/tools/qfreelist_p.h:135 (libQt6Core_tsan.so.6+0x6c6079) #2 next qtbase/src/corelib/tools/qfreelist_p.h:212 (libQt6Core_tsan.so.6+0x6c5915) #3 QReadWriteLockPrivate::allocate() qtbase/src/corelib/thread/qreadwritelock.cpp:564 (libQt6Core_tsan.so.6+0x6c5354) #4 contendedTryLockForRead qtbase/src/corelib/thread/qreadwritelock.cpp:218 (libQt6Core_tsan.so.6+0x6c364f) The loadRelaxed() at the beginning of tryLockForRead/tryLockForWrite isn't enough to bring us the non-atomic write of the recursive bool. Same issue with the std::mutex itself. Pick-to: 6.5 Change-Id: I6f5e371cf94292b643cb36041d1406b19d22cdbe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 80d01c4ccb697b9d390cc0da49c2f111b19b4c5b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 854ef306beff3f336f90d0829d46183366deeaad)
* QXmlStreamReader: fix addData() unnecessary conversion to UTF-8Ivan Solovev2025-04-141-0/+23
| | | | | | | | | | | | | | | | | | | | | | The addData(QASV) overload was unconditionally converting UTF-16 and Latin1 data to UTF-8. However, if we already started reading the XML document, and we know that its encoding is UTF-16 or Latin1, then we know for sure that the new data has to be added as-is. Amends 6bc227a06a0d1392d220aa79ddb1cdc145d4f76e. [ChangeLog][QtCore][QXmlStreamReader] Fixed a bug when addData(QAnyStringView) was incorrectly recoding UTF-16 and Latin1 data to UTF-8, thus potentially mangling it. Fixes: QTBUG-135129 Pick-to: 6.5 Change-Id: Ie1171a5e5596b72a6f160031a4c5a9df3baae4fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b6b725aef59390f403a1a39f49d1318c48f13c07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ec8f043ec514d9556f5e8a1c98b99fa562e813a9)
* TaskTree: Sync sourcesJarek Kobus2025-04-1411-287/+361
| | | | | | | | | | Source sync Creator -> AssetDownloader. Change-Id: Ic503ba04c272718611a4a266bef40e73517e32fd Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 2ab472f6cbcb8505a84dac8acd8e6795b9af0b8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit cabdf3f94ab4973e1c6ac0d70ab196356ce44a32)
* QDockWidget: Fix memory leak when closing floating tabsAxel Spoerl2025-04-143-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDockWidgetGroupWindow (aka "floating tabs") can have a single QDockWidget child only, when a second QDockWidget is hovering over it. When the QDockWidgetGroupWindow detects the disappearance of its second last child, it reparents the last child to the QMainWindow and makes it floating. It removes its last dock widget child from its own item_list and itself from its parent's (the main window's) item_list. Then the QDockWidgetGroupWindow removes itself by calling its deleteLater() slot. A removal from an item_list calls the d'tor of QDockAreaLayoutItem, which deletes the item's subinfo and placeholder item, if they exist. It does not delete the item's widgetItem. In fact the layout accesses the widgetItem member to draw placeholders and decorations. As a consequence, both the QDockWidgetGroupWindowItem and the QDockWidgetItem are leaked, when the corresponding record is removed. Implement QDockAreaLayout::takeWidgetItem(), which transfers ownership of QDockAreaLayoutItem::widgetItem to the caller by returning a std::unique_ptr. Call this method in QDockWidgetGroupWindow::destroyOrHideIfEmpty() and QDockWidgetGroupWindow::reparentToMainWindow(). As a drive-by, use static_cast<QMainWindow *>() and assert a qobject_cast in debug mode. Fixes: QTBUG-135442 Pick-to: 6.5 Change-Id: I055c998f515f2bb461518b7516f56db4673687da Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 40766380224b3a38bbf92b72d8d9baa3762bc06a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5cafb9c760e6381b75e70d5c5f8328e5e62bef5e)
* qdbusxml2cpp: initialize the return value for adaptersIvan Solovev2025-04-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the interface has a method with a specified return value, the generated adapter will contain a code like: bool out; QMetaObject::invokeMethod(parent(), "Func", Q_RETURN_ARG(bool, out)); return out; In this case Q_RETURN_ARG macro makes sure that the variable `out` is properly initialized before being returned from a function, but only if invokeMethod() call is executed successfully. Update the generator to zero-initialize (or value-initialize) the return variable, so that it returns some reasonable value even if invokeMethod() fails. Extend the unit-tests to make sure that the generated adapters always initialize the return variables. Coverity-Id: 479703 Pick-to: 6.5 Change-Id: I4d15ccc6844b5ca454ab9f0cf72fd8e3f0c1b704 Reviewed-by: Matthias Rauter <matthias.rauter@qt.io> (cherry picked from commit 92c2ebdbcca9cfae6e4048004b3bdb58af972209) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit adbb269eb9ee4cd01cc397b5691830906b07486c)
* rhi: d3d11: Fix not setting activeAdapter when importingLaszlo Agocs2025-04-141-2/+7
| | | | | | | | | This was added as part of other work in 6.9. Create a dedicated backport for 6.8. Fixes: QTBUG-135112 Change-Id: I5eeb9b2ce2210116fa2a445fdaab7c5cab2d5328 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Replace qFatal() statements with qWarning() in case of failed queriesTuomas Vaarala2025-04-141-4/+6
| | | | | | | | | | | | | | | In some cases the QNX events can be stale ie. referring to a window object that is already destroyed. This is not necessarily a fatal condition, but there are some qFatal() statements in this case which could be removed. Fixes: QTBUG-135076 Pick-to: 6.5 5.15 Change-Id: I885fa95c323590a814176b8a70ef5b7ee332012c Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> (cherry picked from commit 1e10ede244b70455201df1c459b9586f3c015552) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a65a730ebfdc82e6d3750c0fcd037231849daec6)
* Yield a configuration error with -no-feature-desktopservicesJuha Vuolle2025-04-141-0/+5
| | | | | | | | | | | | | | Yield a configuration error with -no-feature-desktopservices if the platform is either Apple or Android. This should be clearer than a compiler error later on, and also occurs earlier in the process. Fixes: QTBUG-135152 Change-Id: I5dfb9eda12472ed9359767f17423fda63d208d9c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit b145f23770a2f88fc54eaaa33eef579c308f4663) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5ef7bf98a1029044458ad03f07345bc40bfabefd)
* QMetaType/QVariant: update docs that canConvert() operates on typesThiago Macieira2025-04-142-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not on values. That is, it indicates whether there is a conversion path from origin type to the destination type, not that the conversion will succeed when attempted. For example: QObject *o = new QAbstractItemModel; QVariant variant = QVariant::fromValue(o); qDebug() << variant.canConvert<QAbstractItemModel*>(); This conversion *will* succeed for this particular value of a QObject*, so canConvert() must return true for conversions between QObject* and QAbstractItemModel*, despite not all such conversions being possible. This is also done in preparation of changes being done to the conversion routines that may cause some FP->integer conversions to fail depending on the value of the FP. Fixes: QTBUG-135619 Task-number: QTBUG-135285 Change-Id: I138e34fb61a8b8772c8bfffdf75787a2e007d847 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 7cf49085eb47ae660d05e8579c08a3ad3be75021) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 79e3416bb08166cf27aaddaf8edcaf7652e77efa)
* QPointer: don't cause UB when checking for nullptrMarc Mutz2025-04-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPointer is used to track whether a QObject is still alive, and so it's unsurprising that checking whether the pointer is null is sometimes done in situations where the QObject is already in the process of being destroyed and therefore already demoted from T, the QPointer template argument, to some base class. Because of the way we made QPointer SCARY¹, calling data() will cast from QObject* to T*, which is UB if the T was already demoted. It's hard to fix this in the general case, but the various ways to spell isNull() should all be equivalent to isNull() (which does not cause UB, because it doesn't cast). This patch fixes the relational operators against nullptr and adds an explicit operator bool() so that if (p) and if(!p) no longer have to go through (implicit) operator T*(). This does not appear to cause disambiguities, so it's SC. Don't document the operator, it's an implementation detail (and not documenting it lets us pick it back). A follow-up will add the documentation for 6.10+. Add tests, even for stuff that's currently still UB (but marked by an early return). A follow-up patch will try to make as many of these other operations non-UB as possible, too. ¹ Originally 3f7741fbe7ab4140f8f971c0cf88bb04e7feea6b, then changed in cc7239da8d1ab95e68e12a64df3ca3051419cb34 and 351c738fc4586bf354c9363fb78e190bdfca4617. Amends the commits mentioned in the footnote. [ChangeLog][QtCore][QPointer] For `QPointer<Derived> p`, `!p` and comparing `p` to nullptr no longer perform invalid downcasts when the object held in `p` is in the process of being destroyed and has already been demoted from Derived to one of its base classes. Before, these expressions invoked data(), which casts from QObject* to Derived*, a cast which is invalid. Pick-to: 6.5 5.15 Task-number: QTBUG-135626 Change-Id: I1b59062345e1b6933958c7e030d9253d69e7591c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 51cd57116b7465f732253d3f38a2dd78fc704088) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 6a8b3344c09344dfb66ec0e80cd2b4a60999ffeb)
* QDockWidgetLayout: mark the ctor explicitMarc Mutz2025-04-131-1/+1
| | | | | | | | | | | | | | A QWidget* is not a faithful representation of a QDockWidgetLayout, so the ctor should be explicit, even if this is but a private class. Amends the start of the public history. Pick-to: 6.5 5.15 Change-Id: Ib69d72540f094542dbcfc0684e2eec5f90aa532a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 21c9aac20abd700cf9f4bcacbbbe7751eb0aa364) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a589ec7129a4b6dd5cf011636b30b212ed4607b6)
* QMetaObject: save a strlen() in typeFromTypeInfo()Marc Mutz2025-04-131-1/+1
| | | | | | | | | | | | | | | | | QMetaType::fromName() takes a QBAV, so don't feed it rawStringData() (a const char*, causing the QBAV ctor to run strlen() on it), but stringDataView() (a QBAV already, whose length is determined by offset difference in the string offset table and not by strlen()). No measurable difference in runtime speed. Pick-to: 6.5 Change-Id: I583bea9d818deeaac6f62803f7ac5ab4766cb8a5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 1445a33b6fd4c7a401edf68e325e4527e18a667a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c4b7c7b097a68ef77e8d1de4983fc7f50f0efc49)
* qgraphicsitem_cast: replace runtime with compile-time checkVolker Hilsheimer2025-04-131-4/+22
| | | | | | | | | | | | | | | | | Specialize the cast template for QGraphicsItem, where we can skip the runtime comparisons of the type. In addition, replace the runtime check for QGraphicsItem::Type with a compile time check in the main template. We need to do both so that we correctly cast up to QGraphicsItem for custom item types that don't provide their own Type alias. Change-Id: Ic1bff3404fe890747865ce1349cddbcfebb3b77b Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 7af5912e61160681be736ff07a1cd0a0f6b28944) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 6ff7f71c31495ff00a6ce3736152b28ededb8428)
* Determine screen with initialGeometry when not positioning automaticallyMauro Persano2025-04-131-4/+4
| | | | | | | | | | | | | | Popups aren't automatically positioned, so use the screen at the initial geometry for scaling. Otherwise we may end up with the wrong geometry on systems that have multiple screens with different scales. Fixes: QTBUG-134139 Change-Id: I686b1c8ab6cf458d9b849b529ba247ac8c3be064 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 7dc2532bed8977dd4166e9aa4be021b0ec39b5ba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 9b8655cf0d816f1971e8bd920b4c594ddafc8063)
* syncqt.cpp: don't init static variables with non-static dataMarc Mutz2025-04-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Static variables are only initialized once, when control passes over their definition for the first time¹. If they are initialized with non-static data, like the contents of a non-static data member, or the address of one, then all following uses of the object will continue to use the first control pass' data, even if the data members were from an object that has since been deleted. This whole construct appears to have worked merely because these functions are only executed once, or at least not on different objects. But better remove the dangerous construct while it hasn't broken something, yet, and before we e.g. make syncqt a library² or add a mode that makes it scan multiple modules at once. Requires to capture more variables in the parseArgument() lambda; more than fits into an explicit capture list, so use a [&] catch-all instead. As a drive-by, use CTAD to not have to mention the number of elements in a std::array, but have the compiler deduce them, and add const, where it's missing. Amends b89d63515bb352cecfd87e709320a2db5b6a1906 (and maybe a few in-between, we'll see when cherry-picking). ¹ Except corner-case like when initialization fails by throwing an exception. ² see similar ideas for moc, e.g.: QTBUG-132820 Pick-to: 6.5 Change-Id: I65a73059151e3d39341939f613080e6d833a4c30 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 01ced9d45ab87f5d3fd41525621c680965517ee7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8e9ef8df5bb8f436bc425e668f85ee40094a8026)
* QMdiSubwindow: fix UB (invalid member call) in ↵Marc Mutz2025-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ControlContainer::removeButtonsFromMenuBar() The function can be called from ~QMdiSubwindow(), and we checked for QWidgetPrivate::data.in_destructor before proceeding with the removal of buttons from the menubar, but we called QPointer<QMdiSubwindow>::data()->window(), which, at this point in time, had already been demoted to a QWidget: Says UBSan: qpointer.h:75:14: runtime error: downcast of address 0x6040000aca10 which does not point to an object of type 'QMdiSubWindow' 0x6040000aca10: note: object is of type 'QWidget' 00 00 00 00 28 01 99 bc ff 7e 00 00 80 dc 0f 00 90 61 00 00 d8 02 99 bc ff 7e 00 00 00 00 be be ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QWidget' #0 0x7effb955f95a in QPointer<QMdiSubWindow>::data() const qpointer.h:75 #1 0x7effb955f95a in QPointer<QMdiSubWindow>::operator->() const qpointer.h:79 #2 0x7effb955f95a in QMdi::ControlContainer::removeButtonsFromMenuBar(QMenuBar*) qmdisubwindow.cpp:795 #3 0x7effb9563031 in QMdi::ControlContainer::~ControlContainer() qmdisubwindow.cpp:717 #4 0x7effb9566595 in QMdi::ControlContainer::~ControlContainer() qmdisubwindow.cpp:723 #5 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226 #6 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557 #7 0x7effb95cc02c in QMdiSubWindow::~QMdiSubWindow() qmdisubwindow.cpp:2254 #8 0x7effb95cc1d5 in QMdiSubWindow::~QMdiSubWindow() qmdisubwindow.cpp:2254 #9 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226 #10 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557 #11 0x7effb7bffba5 in QWidget::~QWidget() qwidget.cpp:1584 #12 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226 #13 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557 #14 0x7effb85f0dc5 in QFrame::~QFrame() qframe.cpp:235 #15 0x7effb859c747 in QAbstractScrollArea::~QAbstractScrollArea() qabstractscrollarea.cpp:478 #16 0x7effb93c08a6 in QMdiArea::~QMdiArea() qmdiarea.cpp:1703 #17 0x7effb93c0e55 in QMdiArea::~QMdiArea() qmdiarea.cpp:1703 #18 0x7eff8f4f2b7a in QObjectPrivate::deleteChildren() qobject.cpp:2226 #19 0x7effb7bf732d in QWidget::~QWidget() qwidget.cpp:1557 #20 0x7effb920a425 in QMainWindow::~QMainWindow() qmainwindow.cpp:338 Fix by deleting the ControlContainer already from ~QMdiSubwindow(), ie. when we have not yet been demoted to QWidget. Amends the start of the public history. Pick-to: 6.5 5.15 Change-Id: Ia43c857bc1842b2b4957cc79e00f790b045d8f94 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2e3d39130c318da54d77775e82c6c699f236ddf8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 0859415f7d380034a844af0a54e3595469912f17)
* Ensure Qt builds with -no-feature-shortcut on WindowsJohannes Grunenberg2025-04-131-0/+2
| | | | | | | | | | | | | Building without shortcuts would fail due to a missing QKeySequence. This was already handled in the implementation but required an ifdef in the header. Change-Id: I12c92ca480d0abdb518aae00b5b7e259133ef9ca Pick-to: 6.5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0a281beaa76a04665930b1e1cd5349c26ae7f0d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e044a1bf9a4f8fc8aa4f02d878cbc6494b0e4243)
* QTimer: restore BC with Qt 6.7 for MSVCMarc Mutz2025-04-132-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I ported the QTimer::defaultTypeFor() helper from ms to ns granularity, I failed to account for MSVC, in which inline functions of exported classes are themselves exported. As a consequence, the private QTimer::defaultTypeFor(milliseconds) symbol went missing. To fix, re-add it as REMOVED_SINCE API. We don't need to play tricks with QT6_*_NEW_OVERLOAD here, since the overloads have a different signature and the only callers¹ are either passing an exact ms or ns argument² or are in dependent names in templates³ which removed_api.cpp does not instantiate. ¹ this is a private function, so we don't need to look very far... ² the string-based singleShot() overloads ³ and so name lookup (and therefore overload resolution) happens only at instantiation time, not at template parse time (so Integrity and VxWorks compilers will, that is) Amends a60e341145a3b8a106e556e17ae62d2f45ac5d74. Fixes: QTBUG-135578 Change-Id: I375e6f04a3af3824f980fe59775d3eea94250987 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 27ed0014b491f457469914847f0a41926af998f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit bb46df6a7aa6b0d7e797f0deefc93584e36f00b6)
* QInternalMimeData: avoid a QString redundant allocationAhmad Samir2025-04-131-2/+3
| | | | | | | | | | | | | | By using QStringView. Drive-by, explicitly use QBA::constData() to fix the build with QT_NO_CAST_FROM_BYTEARRAY. Pick-to: 6.5 Change-Id: I57bcd877048f3b9889ab8d638979f893857af396 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit f7db58335b78c296624e65ea119ef4cec6334815) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 37ba1457f4e4d4eef44791163d70b758a216d9a6)
* QDockWidget: fix UB (invalid member calls) in QDockAreaLayout::takeAt()Marc Mutz2025-04-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The process by which the QDockAreaLayout changes a QDockAreaLayoutInfo from representing a QWidget that's being deleted to representing a QPlaceholderItem involves the construction of the latter from the former. If a QDockWidget is being deleted, however, at the time the QDockAreaLayout notices, the ex-QDockWidget has been demoted to a QObject, causing the calls to QWidget member functions to be UB: Says UBSan: qdockarealayout.cpp:46:25: runtime error: member call on address 0x7ffe74a429d0 which does not point to an object of type 'QWidget' 0x7ffe74a429d0: note: object is of type 'QObject' 33 7f 00 00 c0 ea 73 6e 33 7f 00 00 00 12 00 00 70 61 00 00 40 cd 41 83 33 7f 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QObject' #0 0x7f339546e251 in QPlaceHolderItem::QPlaceHolderItem(QWidget*) qdockarealayout.cpp:46 #1 0x7f33955169a8 in QDockAreaLayoutInfo::takeAt(int*, int) qdockarealayout.cpp:1780 #2 0x7f3395517175 in QDockAreaLayout::takeAt(int*, int) qdockarealayout.cpp:3432 #3 0x7f33959e38a8 in QMainWindowLayoutState::takeAt(int, int*) qmainwindowlayout.cpp:927 #4 0x7f33959e38a8 in QMainWindowLayoutState::takeAt(int, int*) qmainwindowlayout.cpp:919 #5 0x7f3395a42cdd in QMainWindowLayout::takeAt(int) qmainwindowlayout.cpp:2238 #6 0x7f3393fae246 in removeWidgetRecursively qlayout.cpp:485 #7 0x7f3393fb8300 in QLayout::widgetEvent(QEvent*) qlayout.cpp:544 #8 0x7f3393bde28a in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3298 #9 0x7f3393c5f74a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259 #10 0x7f336b784ada in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111 #11 0x7f336b7874e3 in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.cpp:1551 #12 0x7f336bcc624a in QObjectPrivate::setParent_helper(QObject*) qobject.cpp:2271 #13 0x7f336bccd76c in QObject::~QObject() qobject.cpp:1146 #14 0x7f339434e126 in QWidget::~QWidget() qwidget.cpp:1584 #15 0x7f33955b5815 in QDockWidget::~QDockWidget() qdockwidget.cpp:1362 [...] qwidget.h:816:25: runtime error: member call on address 0x7ffe74a429d0 which does not point to an object of type 'QWidget' 0x7ffe74a429d0: note: object is of type 'QObject' 33 7f 00 00 c0 ea 73 6e 33 7f 00 00 00 12 00 00 70 61 00 00 40 cd 41 83 33 7f 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QObject' #0 0x7f339546e0bb in QWidget::isWindow() const qwidget.h:816 #1 0x7f339546e0bb in QPlaceHolderItem::QPlaceHolderItem(QWidget*) qdockarealayout.cpp:47 [... rest as above...] Fix by dragging the setParent(nullptr) up into ~QDockWidget(). Ordinarily, that call happens only in ~QObject(). But that's what caused the layout to react to the ChildRemoved element too late. When doing it here, the dock widget is still itself, and all the QDockAreaLayout machinery can still access its QWidget-ness. Amends the start of the public history. After consulting with QtWidgets maintainer, not picking to 5.15, since, even though slim, there's a non-zero chance this might break something, somewhere. Pick-to: 6.5 Change-Id: I5472bbb0fcab9fb74272a1da6c2a2896226e12bb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 2c67d47ea15c6dc34cc20d8fbdb406efb19f11d7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 72dfe790981fc63e087021d07969c09dcbb45008)
* Use QByteArray overloads of QString::from{Utf8,Latin1}Ahmad Samir2025-04-133-4/+4
| | | | | | | | | | | Fixes the build with QT_NO_CAST_FROM_BYTEARRAY. Pick-to: 6.5 Change-Id: I7d26235cbb9d26dc4b6d12a68a5ae494574b82a2 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit ce38df4461d09793de675b6161225fc86e5168f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2c2135a3438006fad3a486157a43256f0c063158)
* Clarify XML version support and improve documentation for QXmlStreamMagdalena Stojek2025-04-131-30/+58
| | | | | | | | | | | | | | | | This updates the documentation for QXmlStreamReader and QXmlStreamWriter to explicitly state that only XML 1.0 is supported. While the writer allows specifying arbitrary version strings, it does not implement XML 1.1 features. The reader strictly enforces XML 1.0 and rejects unsupported versions. Fixes: QTBUG-43029 Pick-to: 6.5 Change-Id: I771de29e7915d7a4daafe2fe14d600adfbbac4ac Reviewed-by: Mate Barany <mate.barany@qt.io> (cherry picked from commit 6551bef9d978d195c8824110d8a4ef050a833107) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 0b08fad61ff50a558c135878393d8d6d08be789a)