summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.13' into ↵v5.15.13-lts-lgpl5.15Tarja Sundqvist2024-01-04123-5851/+15197
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ie9df84af22570d601db002e391a1a0d97e7cd9e1
| * QVarLengthArray: fix UBs in emplace()/insert() ([basic.life], broken class ↵Marc Mutz2023-02-191-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | invariant) There are two problems in emplace_impl() (the same code exists as rvalue insert() since 5.10): First, the old code updated size() at the end of the function. However, if, after constructing the new end element, one of the subsequent move-assignments fail (throws), then the class invariant that size() be the number of alive elements in the container is broken, with the immediate consequence that the QVLA dtor would not destroy this element, but surely other unpleasantness (UB) that the C++ lifetime rules decide to throw our way. Similarly, in the trivially-relocatable case, the memmove() starts the life-time of the new end object, so if the following placement new fails, we're in the same situation. The latter case is worse, though, since here we leave *b in some weird zombie state: the memmove() effectively ended its lifetime in the sense that one mustn't call the destructor on the source object after trivial relocation, but C++ doesn't agree and QVLA's dtor will happily call b->~T() as part of its cleanup. The other ugly thing is that we're using placement new into an object that C++ says is still alive. QString is trivially relocatable, but not trivially copyable, so we can't end a QString's lifetime by placement-new'ing a new QString instance into it without first having ended the old object's lifetime. The fix for both of these is, fortunately, the same: It's a rotate!™ By using emplace_back() + std::rotate(), we always place the new object in a spot that didn't contain an alive object (in the C++ sense) before, we always update the size() right after doing so, maintaining that invariant, and we then rotate() it into place, which doesn't leave zombie objects around. std::rotate() is such a fundamental algorithm that we should trust the STL implementors to have optimized it well: https://stackoverflow.com/questions/21160875/why-is-stdrotate-so-fast We know we can do better only for trivially-relocatable, but non-trivially-copyable types (ex: QString), so in order to not lose the memmove() optimization, we now fall back to std::rotate on raw memory for that case. Amends dd58ddd5d97f0663d5fafb7e81bff4fc7db13ba7. Manual conflict resolutions: - no q20::construct_at() in 6.4 - no QVLAStorage/Base/QVarLengthArray split in 6.2 - no emplace_back() in 6.2 (use append(rv) instead) - no emplace() in 6.2 (the same code here implements insert(rv)) - qsizetype (Qt 6) → int (Qt 5) - no constexpr-if in C++11 Change-Id: Iacce4488ca649502861e0ed4e084c9fad38cab47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e24df8bc726d12e80f3f1d14834f9305586fcc98) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Fix few QFileInfo and QDir callsAssam Boudjelthia2023-02-142-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return the file engine impl of QFileInfo::completeBaseName() and QDir::absolutePath() and QFileInfo::fileName() (based on QAbstractFileEngine::BaseName) if the file engine impl is valid. Amends f77668ffec48d8aaad7c74069c6f3e770a305ae1. Task-number: QTBUG-98974 Change-Id: I28a8c75a6f25e30012b0791c12dbde51bfe8f62c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 249d613a60aa6a1347ebc1c29902049247b93324) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * QAbstractItemView: don't access invalid indexes on copy-keyVolker Hilsheimer2023-02-131-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When pressing the copy key the view tried to access the model's data for the currentIndex() without checking whether the index is valid. This resulted in debug output to the console, and might break models that didn't check incoming indexes for validity (or asserted validity). Fix this by checking whether the currentIndex() is valid before reading the model's data for that index. Fixes: QTBUG-106569 Change-Id: Ide75fbdfdbd1451ab6d48f07b22136553c5b2468 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 3a0c33da3d913431391c5b7f4f0e93ea9d2221dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Update bundled libjpeg-turbo to version 2.1.5Eirik Aavitsland2023-02-1321-86/+165
| | | | | | | | | | | | | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.5 Task-number: QTBUG-110336 Change-Id: Ifc08ad7f1a3c5b3e66b11e5a51d523b091288790 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 94efcf9be4c5e46dff463806e278fcee90ff4d53) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| * Revert "Copy only files that belongs to QML module"Alexey Edelev2023-02-081-43/+16
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f0f27b20b61c65e94c098cdd4f027dfb7f31a44c. Reason for revert: This breaks Quick style plugin loading QTBUG-110433 Task-number: QTBUG-36637 Task-number: QTBUG-97834 Task-number: QTBUG-110433 Change-Id: I11fda4cbbb70e988543d380b911cb9f97e688adc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * macOS: Skip deployment target runtime check when detecting compat versionTor Arne Vestbø2023-02-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the main executable is built with a pre-macOS 11 SDK, the macOS kernel and system libraries will enable a compatibility mode for reporting the system version, reporting 10.16 instead of 11/12/13 etc. This happens at at such a low level that even manually reading the version from /System/Library/CoreServices/SystemVersion.plist is intercepted. Working around this by temporarily setting the SYSTEM_VERSION_COMPAT environment variable is unfortunately not possible, as it's only read on process creation/initialization. The same goes for the kern.system_version_compat sysctl, as once it's set it can not be changed back to its original value, and it's not clear whether this sysctl should even be touched. As long as we have no reliable way of reading the actual current operating system version, we need to bail out of the deployment target verification, to avoid false negatives where a plugin or library, built with a deployment target of say 11.0, is loaded into an application built with a pre-11.0 SDK, but running on macOS 11+. Change-Id: I9c757a276726175c5dda694ffc1b88f1681d00fb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit bac93ce5eba10ae1e5d165b464a7a9e3b4dd6561) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QXcbConnection::getTimestamp: do not return stale timestampRoland Pallai2023-02-033-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is `PropertyNotify` event generated by `xcb_delete_property()` at return could be reported as an actual timestamp at next call due to a missing `state` filter. Because `PropertyNotify` is generated even if an unchanged property value is set we can get rid of this delete event easily. This issue causes observable problems in kwin_x11 (KDE project) too. Fixes: QTBUG-56595 Change-Id: Ice6cfa934e3769d86e9f7264e369dc5918c8542a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> (cherry picked from commit 03ac8c7397b9f070a8ef5f33b4675411293b0723) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Update comments in QQuaternion::getEulerAnglesInho Lee2023-02-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | A comment from the patch 6ffc8d8eb6c44fbd51e37770e7013c4610ead96d is a little ambiguous. This patch is just to give information about the modification. Task-number: QTBUG-72103 Change-Id: I6bfc3ae926c118de0d969a4b44f438c24f8d4f72 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 8f9049ddbcedbc1f623acb7bfcd2b31c286f4583)
| * QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock casesYuya Nishihara2023-02-031-39/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is heavily inspired by the patch written by Inho Lee <inho.lee@qt.io>, which says "There is a precision problem in the previous algorithm when checking pitch value. (In the case that the rotation on the X-axis makes Gimbal lock.)" In order to work around the precision problem, this patch does: 1. switch to the algorithm described in the inline comment to make the story simple. 2. forcibly normalize the {x, y, z, w} components to eliminate fractional errors. 3. set threshold to avoid hidden division by cos(pitch) =~ 0. From my testing which compares dot product of the original quaternion and the one recreated from Euler angles, calculation within float range seems okay. (abs(normalize(q_orig) * normalize(q_roundtrip)) >= 0.99999) Many thanks to Inho Lee for the original patch and discussion about rounding errors. Fixes: QTBUG-72103 Change-Id: I8995e4affe603111ff2303a0dfcbdb0b1ae03f10 Reviewed-by: Yuya Nishihara <yuya@tcha.org> Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 6ffc8d8eb6c44fbd51e37770e7013c4610ead96d) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Pass short time format to GetTimeFormat from GetLocaleInfoIlya Fedin2023-02-031-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TIME_NOSECONDS doesn't really switch to short time format, just removes the seconds from long time format. On picking to 5.15, getLocaleInfo() is templated to return QString, not QVariant, so drop its return's toString() in the new code. Also rename a later local variable to avoid shadowing format (and, incidentally, match dev so as to avoid conflicts there on any later patches). Fixes: QTBUG-110627 Change-Id: Ie799958f3942c657f00bc8196588258661ddc1d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 763884cfb7be0cadd353cfa3b9b760d521851718) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Mate Barany <mate.barany@qt.io>
| * Android: fix height calculationSamuel Mira2023-02-031-74/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The application height calculation relied on the Display.getMetrics to obtain the size of the current app window. It works properly on stock android and Samsung devices, but not on some Huawei and it's unknown on other vendors. This patch changes the way the height and weight are calculated by using the provided values. Task-number: QTBUG-107604 Task-number: QTBUG-109268 Task-number: QTBUG-97503 Task-number: QTBUG-107923 Task-number: QTBUG-109351 Task-number: QTBUG-110501 Change-Id: I0b0d1a0e4688f10530054afd26e34f55a92ea2da Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 48ebd4e318d5fb2d7ffe4b8215cd16cf5638215e) Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
| * SQL/ODBC: fix some users of toSQLTCHAR() to not assume identical UTF-8/16/32 ↵Marc Mutz2023-02-031-70/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | string lengths We already fixed the implementation of toSQLTCHAR() in 66767eea46bea0f19f8ae5ad6ebc641d86867701 to not assume that a UTF-8 or UTF-32-encoded string has the same number of code points as the equivalent UTF-16 string, but it turns out that users of the function, as well as other code, also failed to account for this. This patch fixes callers of toSQLTCHAR() to use const auto encoded = toSQLTCHAR(s); ~~~ use encoded.data(), encoded.size() ~~~ (except we can't make `encoded` const, because the SQL API isn't const-correct and takes void* instead of const void*) instead of the anti-pattern ~~~ use toSQLTCHAR(s).data(), s.size() ~~~ As a drive-by: - Extract Method qt_string_SQLSetConnectAttr() - skipping an unneeded .utf16() call (a NUL-terminated string is not required for calling toSQLTCHAR()) - de-duplicate some code in exec() - and make a comment there slightly more informative - replace - NULL with nullptr - size() == 0 with isEmpty() - C-style with constructor-style casts Manual conflict resolutions: - _L1 vs. QLatin1String - u'x' vs. QLatin1Char('x') - qsizetype vs. int Change-Id: I3696381d0a93af8861ce2b7915f212d9e5e9a243 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 46af1fe49f7f419dc1b3231de9860e2da0ea48f8) Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * ODBC SQL driver: fix conversion of QByteArray to QVLA<SQLTCHAR>Marc Mutz2023-02-021-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QByteArray is assumed to contain an SQLTCHAR string (so, either UTF-8, UTF-16 or UTF-32-encoded). Only in the UTF-8 case would the size of the byte array be the same as the size of the SQLTCHAR string in codepoints, yet the size in bytes is what the code passed to the QVLA<SQLTCHAR> append() call, causing it to read past the QByteArray buffer in the UTF-16 and UTF-32 cases. Fix by properly calculating the string size from the size-in-bytes and then memcpy()ing into the QVLA. We use memcpy() and not QVLA::append(T*, n) because the QByteArray buffer need not be aligned on an alignof(SQLTCHAR) boundary (certainly not since it gained the prepend "optimization"). Manual conflict resolutions: - dealt with 32-bit-ness of container size_type vs. Qt 6's 64-bit Change-Id: If3838c3dee89e6aca65541242642315b8e1fa6b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 4c445ef0bae8b36ec4a742552f0ebd81a1a90723) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Docs:Android: Add docs notes about support for content UrisNicholas Bennett2023-02-015-0/+59
| | | | | | | | | | | | | | | | | | | | | | Add some details about the support of Qt apis (QFile, QDir, QFileInfo) for Android content uris. Fixes: QTBUG-99664 Task-number: QTBUG-98974 Change-Id: I4b884623702ccad116d47049e34ccddfe21f83ca Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> (cherry picked from commit a0ca5f433fdc45e97e461ece2d9839eebd3c7ea0)
| * QODBC: correctly fill cache when index() is calledChristian Ehrlicher2023-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | QODBCResult::isNull() incorrectly checked for the validity of the internal row cache which lead to wrong results when the requested column was not yet cached. Change-Id: Ic7dcc2117e6f05b63c83f21c6a84ba7e0bda2b2d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 91374bb6322cf09525e99698c8fae7688c227d74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix ignored name filter in QFileDialog::getOpenFileContent()Sze Howe Koh2023-01-311-1/+1
| | | | | | | | | | | | | | | | Fixes: QTBUG-104948 Change-Id: I83a565bfe604472fcdeb8757464e0e350da5d766 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 709ca8212ec2b8c4bd2d7acea04e5a70fcec3c2d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * GTK3 theme: simplify codeYuhang Zhao2023-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | There's no need to first convert to QString and then convert back to QByteArray. Change-Id: Idedcf3143f44c640a9259f16e364dfe76ecf4c0d Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit e86a5f5f8b184562b5cde0da8882a2d8ebce84d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QToolButton: Elide text when constraints prevent from showing whole textChristian Ehrlicher2023-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | Follow-up of b2a282d7c7b8f49819bbc86ed705980438ecb04b - elide the text also when the QToolButton has no icon (=text only) Fixes: QTBUG-64132 Change-Id: If4d3758452f37df411931a6628846988a3418d8e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 021906f6c985b838461d28c7f121d4c3bc7e6499) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * forkfd/linux: add support for LoongArchWANG Xuerui2023-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | This architecture is not CLONE_BACKWARDS in any way. Matching OpenDCDiag PR: https://github.com/opendcdiag/opendcdiag/pull/169 Change-Id: Ibceccfd20d270b30302a936885d12e4c55cdd833 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0ab51dcc3c0cca0d84822f3871d98ffa46b6b2e4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * ibus: check object validity before honoring `inputMethodAccepted()`Phan Quang Minh2023-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `inputMethodAccepted()` always return false if there is no current focus object. This means QIBusPlatformInputContext will fail to send the necessary `FocusOut` request to the input context, causing IBus to not send the appropriate content type information to the panel service when the application regains focus and issue a `FocusIn` request. This results in issues like https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5346, which can happen when a Qt application is in foreground as the IBus daemon fails to propagate the content type information to GNOME Shell, which acts as the panel service on GNOME systems. Fix this by checking for the validity of `object` before honoring the result of `inputMethodAccepted()`. Change-Id: I6b79ffc7c5f03ffc05527c29e52a0859f3594bfa Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 95b4cfb1af9aefe3ff3aa151804f464388329c63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * ODBC SQL driver: deal with different sizes of SQLTCHAR correctlyMarc Mutz2023-01-261-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither the UTF-32, nor the UTF-8 recoding of a UTF-16 string is necessarily of the same length as the input. The UTF-32 version may be shorter, if surrogate pairs were encountered. The UTF-8 version will be longer whenever the string contains non-US-ASCII characters. Split toSQLTCHAR() into three functions, templated on sizeof(SQLTCHAR), and use QVLA's range-append instead of manual memcpy()s. This patch specifically doesn't use constexpr-if, as that's not available until C++17, which Qt 5 doesn't require. Change-Id: I0bfcb66eb321598908ef00ac34c888fdbccf9316 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 66767eea46bea0f19f8ae5ad6ebc641d86867701) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Android: pass EXTRA_INITIAL_URI to native FileDialogAssam Boudjelthia2023-01-232-6/+28
| | | | | | | | | | | | | | | | | | | | | | Allow setting the initial directory where the file dialog will be opened. Change-Id: I1395b367c74d28fb2890ac53a90456c3ac4c1b05 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 609e14724edfd8d8cef23c5f30ad7812a359ed8d) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
| * Doc: Only list qt core classes in qt core io groupAndreas Eliasson2023-01-234-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | The group page for Qt core classes related to I/O include classes from other modules. Remove these classes from the group; it may confuse the reader. Fixes: QTBUG-110020 Change-Id: If7df85523ce6b3aa09605bd89d9899ce308d2671 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit 76ecff6aebb35f4e39439aab8d18d828c3c8a1fd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QFileSystemEngine: URL encode path in trash info, use relative pathJonas Kvinge2023-01-211-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the specifications, the path in .trashinfo should be URL encoded. The path can be relative when possible, otherwise changing the mountpoint will break restoring files from trash. But don't do that for root (/) and home. For more info, see.: https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html Change-Id: Id8271a893a007f4cb5c10611f2b1bc71c1ff4860 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 314a4d121f55a7a6cd8335c9953d105574efab76) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * [doc] Warn users about data races regarding qt_ntfs_permission_lookupMate Barany2023-01-192-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | qt_ntfs_permission_lookup is a non-atomic global variable that is prone to data races. Make a remark about this in the documentation. Task-number: QTBUG-105804 Change-Id: If7c64f3ab7d2c3b1487fe56204a4e66c420b0604 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 696ad54e5d76dd063cbb02d0c288fdece6ee75d0) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
| * [doc] QSharedPointer: add some missing docsMarc Mutz2023-01-182-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added docs for - move-ctor, -assignment operator - move-construction and -assignment from QSP<X> - qHash() There's more stuff missing, but I declare 'twas enough qdoc wrangling for this round. The texts are taken from other smart pointer docs, esp. QESDP, so they're consistent. Manual conflict resolutions: - swap() wasn't marked as noexcept in qsharedpointer.h, but is in qsharedpointer_impl.h, so kept the Qt 6 version. Fixes: QTBUG-83134 Fixes: QTBUG-63700 Change-Id: Iff980d043e1635ed6cfdd3113c68bc23f3a0bad7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 5dc0f52e7047ca5927e6741fda554cb090184b71) Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Disable feature vkgen if vulkan was explicitly disabledJoerg Bornemann2023-01-181-0/+1
| | | | | | | | | | | | Fixes: QTBUG-110066 Change-Id: Id53071c71e40b1f1968075686144835c39eafd6d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
| * Android: handle move operation with content urisAssam Boudjelthia2023-01-171-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow moving content uris if the destination is provided a full content uri with a parent that's different from the source content uri (i.e. different folders). Note: since the underlaying Android APIs don't always know about the parent of a uri, we do some step to deduce that, but that's not always guaranteed to work. Task-number: QTBUG-98974 Change-Id: If21954e5963f4eb0b96c7ccd983943ea2cab5b24 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit c203ec2720b694fd877512da531a227e0f3310cb)
| * Android: handle rename() operation with content urisAssam Boudjelthia2023-01-172-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | Allow renaming content uris if the destination is provided as a direct fileName (i.e. not full content scheme path), and if the destination has the same trailing path (or parent) which means a rename in the same folder structure. Task-number: QTBUG-98974 Change-Id: Ibc4973366807dd5284c19912ab04ff90f2a573cb Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit c1fa5d602c541b06e3e2fc2d02f5d62060c84504)
| * Android: Add facilities to handle more content URIs operationsAssam Boudjelthia2023-01-173-261/+716
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use DocumentFile and DocumentsContract to support more operations on content URIs, such as: * listing files and subdirectories with usable content uris * mkdir, rmdir * creating non-existing files under a tree uri * remove And since dealing with content URIs require some level of user interation, manual tests were added to cover what's been implemented. Note: parts of the code were from from BogDan Vatra <bogdan@kdab.com>. Task-number: QTBUG-98974 Task-number: QTBUG-104776 Change-Id: I3d64958ef26d0155210905b65daae2efa3db31c1 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit e5d591a0d09032d1870e47d1bf59c9069ea0a943)
| * Fix infinite loop when iterating content uri sub-files/dirsAssam Boudjelthia2023-01-174-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | make QAbstractFileEngineIterator::currentFilePath() virtual and implement it under AndroidContentFileEngine to return current fileName because content uris shouldn't be constructed manaully like normal file paths. Fixes: QTBUG-104776 Change-Id: I4643a73a3bd4019bedaa056c35468117bcec18dc Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit f3c998510d3a6c8fc468e449d66b0280119d0a8f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Return the QFileInfo::baseName/QDir::dirName() from fileEngine implAssam Boudjelthia2023-01-162-2/+6
| | | | | | | | | | | | | | | | | | | | | | Get those values from the file engine instead, this is relevant especially on Android for content uris. Task-number: QTBUG-98974 Change-Id: I65fe4c59e5f1feed0dcf14cc8988b4a40d9d979e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f77668ffec48d8aaad7c74069c6f3e770a305ae1) Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
| * Fix deletion order also for QImageReader/Writer::setDevice()Eirik Aavitsland2023-01-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | Avoid dangling or incorrect device pointer during handler destruction. This was recently fixed in the destructors, fixed here also for the setDevice() functions. Change-Id: I85b64726cd88d2c8e63eee59d5b4f2ae488df61b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 5633cb69f68ca3d3b82476f9025d863f804e76c1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * SQLite: Update SQLite to v3.40.1Andy Shaw2023-01-063-48/+151
| | | | | | | | | | | | | | | | | | [ChangeLog][QtSQL][SQLite] Updated SQLite to v3.40.1 Change-Id: Ic17019f65083b24238025fe6ea6ee9872ac783fe Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit cac325fdc11a409473bd13a758de608eb3df1540) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix cache maybe invalid while the signal is actived from queueJannis Xiong2023-01-063-1/+8
| | | | | | | | | | | | | | | | | | | | with default QObject::connect signal may active from next message loop. invalide cache will hit while accessibility interface is called from windows. Invalide cache will lead to a crash Fixes: QTBUG-106653 Change-Id: I5359672bcd60ed6cfb2edf238645225164cb1b88 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 80f44954f6872afb5aa37e6737c3e1ac68ad3577) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix potential corruption with image format conversion on arm neonEirik Aavitsland2023-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | For tiny scanline lengths, even the initial offset to align on 16 bytes may overflow. Fixes: QTBUG-109477 Change-Id: I198c6fa5a2551a951893515f905bb7cc35479608 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 7eccd7ac1c98e0c15c0b4a13d036a5ef46896d8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Android A11Y: Only access the main thread when it is not blockedJulian Greilich2023-01-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the qtMainLoopThread calls QSGThreadedRenderLoop::polishAndSync(), it waits for the QSGRenderThread. In the QSGRenderThread, QAndroidPlatformOpenGLWindow::eglSurface() calls QtAndroid::createSurface() and waits for the "android main thread" to return a valid surface. When the "android main thread" now calls "runInObjectContext" (e.g. by calling QtAndroidAccessibility::childIdListForAccessibleObject()) it waits for the qtMainLoopThread and the program is stuck in a deadlock. To prevent this, we protect all BlockedQueuedConnection from the "android main thread" to the qtMainLoopThread by acquiring the AndroidDeadlockProtector. When QAndroidPlatformOpenGLWindow::eglSurface() already acquired the AndroidDeadlockProtector we abort the current A11y call with an emtpy or default value. Note: b8a95275440b8a143ee648466fd8b5401ee1e839 already tried to fix this by checking "getSurfaceCount() != 0", but there are situations, where a new surface is being created while an old surface is still present. Task-number: QTBUG-105958 Change-Id: Ie40e8654c99aace9e69b0b8412952fa22c89f071 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit b832a5ac72c6015b6509d60b75b2ce5d5e570800) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * ibus: support high dpi for cursor rectangleLiang Qi2023-01-051-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on both X11/xcb and Wayland. Following similar approach in QFcitxPlatformInputContext::cursorRectChanged() https://github.com/fcitx/fcitx5-qt/blob/master/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp#L490-L532 Tested with following configurations: * GNOME on xorg, 100%/125%/150%/200% scale, 1 and 2 monitors * KDE/Plasma X11, 100%/150%/200% scale, 1 monitor * GNOME on Wayland, 100%/200% scale, 1 and 2 monitors Enable fractional scale on GNOME: gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']" Fixes: QTBUG-103393 Change-Id: Idfd3153e4cd9f9530b4db6f089830ec47451a19e Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru> Reviewed-by: Weng Xuetian <wengxt@gmail.com> Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 3790821b220ff6ab3c51a5c0b35581c00bc4e84d)
| * ibus: add SetCursorLocationRelative in InputContext.xmlLiang Qi2023-01-052-0/+13
| | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-103393 Change-Id: I90c48a0d698636ed289d6f6c1485875e2e91fb34 Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru> Reviewed-by: Weng Xuetian <wengxt@gmail.com> Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 54002671bd68b1c59b61a630c9333b2aab286483) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix deletion order in QImageReader/Writer destructorsEirik Aavitsland2023-01-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | The device would be deleted before the image format handler, and hence be a dangling pointer that could easily cause a crash if the handler or codec would access it on destruction, e.g. for cleanup. Change-Id: I51d16b1feddc5945955ac75a2e8701233dba7b82 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit f091026be1deb4b4a90f32585b9b22f97209866a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QString: use inheritance, not template aliases, for arg() constraintsMarc Mutz2023-01-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For unknown reasons, using template aliases breaks on some MSVC versions and a valid arg(std::declval<QStringRef>(), std::declval<QString>()) call gets SFINAE'd out. Partially reverts e0963f7d6a31dd26629a9553c0fe00d0c8b2f22f. Add a test. Fixes: QTBUG-109723 Change-Id: I832357c91efa4caafce40b50dd76a700de2c58d7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Fix the ref-counting for the std::function version of tryStart()Allan Sandfeld Jensen2023-01-031-0/+4
| | | | | | | | | | | | | | | | The refcount isn't used, but is asserted in debug mode. Fixes: QTBUG-109732 Change-Id: I5c4f402ca2a15b92f318896de994f3bfedf4eb87 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Android: Fix UI is scaled smaller than beforeSamuel Mira2023-01-022-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 413593183bbb1137fdc784d98c171d67a167bb32 patch changed the way how the display metrics are retrieved. By doing so, it was found that the previous way retrieved the scaledDensity always equal to density. It is intentional for scaledDensity to be dependent on the font scale chosen by the user. However, this change altered not only the font scale but also the layout. This patch will make the layout dependent on the density instead of the scaledDensity and normalize the way the display metrics are retrieved among Android versions. Currently, the fontScale is ignored, QTBUG-109566 will track future developments. Fixes: QTBUG-109026 Change-Id: I6adacd17583cbe9bee368af35c50b780872ab222 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 99893a914a821567e10935ffb8be24df7147ccd9) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Android: fix Android assets handler not listing dirs with only sub dirsBartlomiej Moskal2023-01-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like AAssetDir_getNextFileName is not enough. Directories that contain only other directories (no files) were not listed. On the other hand, AAssetManager_openDir() will always return a pointer to initialized object (even if the specified directory does not exists), so we can't just leave only it here. Using FolderIterator as a last resort. This approach should not be too time consuming. As part of this fix, add some unit tests to cover/ensure assets listing/iterating works as expected. Fixes: QTBUG-107627 Change-Id: Id375fe8f99f4ca3f8cad4756f783ffafe5c074df Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 4ceee3911a2ef567f614fc296475bc2b2a0e3add)
| * Android: fix deprecations for getDrawable() on QtMessageDialogHelperAssam Boudjelthia2022-12-271-4/+8
| | | | | | | | | | | | Change-Id: Icd359663af11f44b4bcf0cd4e4f1f7f5a51242e4 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 31a0d99fa565d39bf39f0c3ae5ed00859679a969)
| * Android: Fix deprecations AlertDialog.setButton()Assam Boudjelthia2022-12-271-3/+10
| | | | | | | | | | | | | | | | | | | | https://developer.android.com/reference/android/app/ AlertDialog#setButton(java.lang.CharSequence, %20android.content.DialogInterface.OnClickListener) Change-Id: I470acba581b7226b2d4a56754cf6372baa167eb4 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 40b42ac517c45beff3caf5e991c84739ac014912)
| * Doc: Increase Test Function TimeoutJaishree Vyas2022-12-211-0/+41
| | | | | | | | | | | | | | | | | | | | Documentation on QTEST_FUNCTION_TIMEOUT environment variable Fixes: QTBUG-88652 Change-Id: Ib851eb2312088cf6b9ab277faa571757f4076ad4 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 46d2b45d2c33b066ee4ef31f5a44ee5c6b8bae73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QtMiscUtils: add missing toAsciiUpper(), use it in mocMarc Mutz2022-12-202-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to make moc code locale-independent. The C toupper function is locale-dependent. Given the right locale (Türkiye, e.g.), toupper('i') is either - İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or - i (unchanged; if it isn't) Both results are wrong for the present use-case. Fix by adding QtMiscTools::toAsciiUpper(), complementing existing toAsciiLower(), and using that. It's private API, but moc.h, despite the name, is not a public header. Task-number: QTBUG-109235 Change-Id: Iaf071ba2113b672aa0aed3da6a4e1d47fb659365 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b8c2a0c18a0676595946b5543ff88492a5fc7876) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * QLatin1/String/View: don't decay the arg() argumentsMarc Mutz2022-12-191-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This turns const char[] arrays into const char* pointers and therefore prevents the implicit conversion of string literals to QString in QT_RESTRICTED_CAST_FROM_ASCII. Fix by avoiding the decay. Also simplify the template magic. Manual conflict resolutions: - QLatin1StringView → QLatin1String - port away from C++17 std::disjunction Change-Id: I88164a1866ac71b41d9cd1564f3a5e83d2d42aaa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ba52b29d336cc32a462306d9011b75e9948c7040) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>