summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QVarLengthArray: fix aliasing error in insert(it, n, v)Marc Mutz2021-06-281-1/+1
| | | | | | | | | | | | | | | | | | Taking the copy after the resize is completely pointless: the copy is there to ensure that `t`, being a reference potentially aliasing an element in [begin(), end()[ before the resize(), isn't invalidated by the resize(), so it must be taken before resize(). Add a comment so the next rewrite doesn't cause this to be mixed up again. [ChangeLog][QtCore][QVarLengthArray] Fixed an aliasing bug affecting insertions of objects aliasing existing elements. Change-Id: I26bc449fa99bf8d09a19147a12a69ac4314cc61d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 6e57e41f9aef5ccfa122c10bc6253d47dafd93d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix usage of logging category on AndroidAssam Boudjelthia2021-06-281-1/+7
| | | | | | | | | | | | | | | | Android logs have a tag/category field in each log entry, which currently if defined by Qt, it's being included as part of the message and not used as a tag as it's supposed to be. This patch fixes that behavior. If a non-default category is defined, it will be used as a tag, otherwise the application name is used as before. Fixes: QTBUG-94708 Change-Id: Ie56187f23a47cda6d82e14fdec7c8903d3ee40b6 Reviewed-by: BogDan Vatra <bogdan@kdab.com> (cherry picked from commit 87d8ee755bfdef8e72a122789c2e3ed382881a12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix harfbuzz-ng compilation for IntegrityTatiana Borisova2021-06-281-0/+6
| | | | | | | | | Add --restrict definition, because GHS compiler doesn't support it by default Change-Id: I6766f2fe309802ad9de333edd6ed43f7a187616f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 22a058bcf03a706297ea9484bda0d8331c4c05d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Documentation: Remove section advertising AmazonFriedemann Kleint2021-06-281-13/+0
| | | | | | | Change-Id: Ibf61cdf4ccb08c00c74c88e66aac200971be62d1 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 0c09f4489d8a97b8fb47afebf15937398752f23d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use https for links to unicode.orgPaul Wicking2021-06-255-20/+18
| | | | | | | | | | | * Change all outbound links in user-facing documentation. * Reflow lines that exceed 100 cols as mandated by clang-format. * Add unicode.org as a global \externalsite. Change-Id: I2ba1e434aa913e678406d62c2801f1a8b2d9e4f4 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 7968281444c967628566337ce3493058825cb946) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Improve QTransform documentationPaul Wicking2021-06-253-12/+31
| | | | | | | | | | | | | * Explain QTransform's model of vector/matrix operations. * Improve snippets used to illuminate QTransform's behavior. Fixes: QTBUG-83869 Change-Id: I84c3b1a221c139ee992f82c3ee4aebadeef8ee63 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit ae2ef9dbf060ba101e32bae2b5edfed979630e30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Unregister screen notification handlers on QGuiApplication shutdownTor Arne Vestbø2021-06-252-3/+16
| | | | | | | | | | | | | In the case of a plugin, the plugin might be unloaded, and destroy its QGuiApplication. We don't want the screen notification handlers to outlive the application, as that results in crashes. Fixes: QTBUG-91919 Done-with: Yang Yang Change-Id: I3a4c0fcf97b785357516d1dac34489511400f154 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 96469ae338c3146f4efea3fabaaae5bc6ecd6a59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFutureInterface: remove the inconsistent and unneeded includeSona Kurazyan2021-06-251-1/+0
| | | | | | | | | | QMutexLocker is declared in qmutex.h, which is already included. Task-number: QTBUG-94407 Change-Id: I78e0630c27ef7f85feae68e98f8cdcbe4e142cd8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a527fbf1797fca1a2f764bca85551562be460bb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Schannel: Get rid of Windows < 10 codeMårten Nordheim2021-06-251-7/+4
| | | | | | | | | | No need to check if we're running on windows 8.1 or above. We always are. Change-Id: I9f2e7a58631064e573725705882a603e900c7e39 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 43a36dfd81ca5c01b6afe66c1ad3ddf505acae99) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consistent indentation for all Q_PROPERTYsAndreas Buhr2021-06-2534-77/+155
| | | | | | | | | Task-number: QTBUG-94407 Change-Id: I8c97a0b2de2bed78456322be271724fc47479d83 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 1587d75b5e960854be17a017e8fc1cde03ed8058) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSslSocket: Set isEncrypted to false on disconnectMårten Nordheim2021-06-242-0/+2
| | | | | | | | | | Since we're no longer connected, much less encrypted. Was done in schannel backend, but not in ST or OpenSSL Change-Id: Ia49387be0088f899a0c89091f7e468dba1c0eee6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 664a6621fb54aaa5824ff4f3f09cbc21ecefcd3b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_http2: use the supportedFeatures() instead of macrosTimur Pocheptsov2021-06-241-0/+4
| | | | | | | | | | | With the recent change, 'system' headers gone: not in the test code anymore, so, for example OPENSSL_VERSION_NUMBER is undefined, making the test to select a wrong code-path - 'h2c', instead of encrypted h2. Change-Id: I3b201e21fac56875c9045c7463e2ae69af4c6470 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 13ce568b768bbdaa19adc4207a04b74414c14d62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consistent indentation for BINDABLE propertiesAndreas Buhr2021-06-248-16/+23
| | | | | | | | | | Triggered by API review in Gerrit patch 355960. Task-number: QTBUG-94407 Change-Id: I7cafc1cc9d4b929040b53c6bf92c91d73c3b39f2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 4b850065b1631437b65542b3cb1c16077d2f0230) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use On icon for pressed dock widget title buttons without frameVolker Hilsheimer2021-06-241-2/+4
| | | | | | | | | | | | | | | | The QCommonStyle provides explicit pixmaps for the SP_TitleBarCloseButton and SP_TitleBarNormalButton, but never showed the "down" pixmap on macOS because the button has no frame, so the On state flag was never set. Set the style states so that the "down" pixmap is used on a button that is either pressed or checked if it doesn't have a frame. Since QIcon only has two states, use the "On" state for both pressed and checked. Task-number: QTBUG-38776 Change-Id: Ic04070196b97a4fb66d7a2669e9894fd7960230e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit b278a4f9b04e80772573a686eac6552436d15915) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: fix cursorTheme update issueTang Haixiang2021-06-241-2/+6
| | | | | | | | | | | | | | | | Clear the cache when cursor theme changed. Idealy we should subscribe root window's RESOURCE_MANAGER property to update cursor theme via Xcursor. KDE already has a daemon KDE GTK Configurator to sync KDE settings to GTK. Then we can register the fallback there both for KDE and GTK changes. See also https://invent.kde.org/plasma/kde-gtk-config Fixes: QTBUG-94538 Change-Id: Ia4de30930a0dc1dc306c61e1553970c3dab67bd6 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 7311cdc0d2c10d47511e5b4850e3b348ea10e0d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove const from signalAndreas Buhr2021-06-241-1/+1
| | | | | | | | | | | We made a signal const. This does not make sense. Task-number: QTBUG-94407 Change-Id: I372da9c045ba880f8fba48399e441b53c1683e93 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit fa664e0b2ad748a5b56de8ca0fd9ee3ed1966e7d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QString: Respect precision when reading data for %.*s format stringUlf Hermann2021-06-231-4/+8
| | | | | | | | | | | | If we disregard the precision we may read a very large string that we subsequently discard. Furthermore, people use this to read non-null-terminated strings, which randomly crashes. Change-Id: Ifa255dbe71c82d3d4fb46adfef7a9dc74bd40cee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e99e07cb5c939ca5bbb1dfdeb66c862d6cd4f2f2) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Extend documentation for QFile:copy()Paul Wicking2021-06-232-10/+15
| | | | | | | | | | | | | - Add information about symlinks and file metadata. - Reflow text. - Extract text common to both overloads to a .qdocinc file for consistency and to avoid duplication. Fixes: QTBUG-94706 Change-Id: I3c730fd63f4018a1a573bb56751fedd2270a3247 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cc2fdce35e6a958e021b4d4cdc0ace1a91b06d0c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix coding-style violation in QUtf8StringView::operator==()Edward Welbourne2021-06-231-3/+3
| | | | | | | | Task-number: QTBUG-94407 Change-Id: I00a9c14963fe8f8d1b524350aec5544ff5dd609c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 5ad13ec57dc4829813557069806b44000dd836e2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Coding style: remove redundant braces, break long lineEdward Welbourne2021-06-231-4/+6
| | | | | | | | Task-number: QTBUG-94407 Change-Id: Id9bbc3871bc3350fa5cc656f4248de8e6511ff05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9625c744a939d657d5c906ee93d08951fd7732dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename PermisionType to spell permission correctlyEdward Welbourne2021-06-236-13/+16
| | | | | | | | | | Thanks to Giuseppe for pointing it out in API change review. Task-number: QTBUG-94407 Change-Id: I3b8fb653b5efa7ded51f81aadb35d361e7dbf19c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit ccac1b185abd84e4a1c500bef42961d95f5f882e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: bump the OpenSSL minimum supported version to 1.1.1Tasuku Suzuki2021-06-231-2/+2
| | | | | | | Change-Id: Ibfc8b64be23eb023dafb875f367da98b7c7bb5f6 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 418850d55976ca283f1ad92997379df27bb6028a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qsimd: Don't force RDRND on if __AVX2__Thiago Macieira2021-06-221-5/+4
| | | | | | | | | | | | | Like AESNI, RDRAND is an optional extra feature that is not always enabled in all parts. Probably something to do with export restrictions, but I've only seen that in low-end parts. Drive-by removal of "AES" where it was no longer relevant. Change-Id: I7246c3e7bb894e0d9521fffd168af3fc0fb638a1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 9cc7f233c9e2f2bacdcb06f166d0812d58eb4bfc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix potential double-free in QSqlCachedResult::cleanup()Edward Welbourne2021-06-221-1/+3
| | | | | | | | | | | | If d->sql is non-null, it gets freed; later in the same function, it gets reallocated, unless the query is empty, in which case the now-freed value was still recorded, so that later clean-up might find it and mistakenly think it needs to be freed again. Clear when freeing. Change-Id: I8d37d2ba1fcaa320916eaf30dceaa720bbf62f38 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 0e1da78ad36a0639275b7a0ac8a046f46577452d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix leak of transaction context handle in QSql's OCI driverEdward Welbourne2021-06-221-11/+21
| | | | | | | | | | | | | | | Transaction handles were allocated but nowhere freed. Thanks to Stefan Latsch for pointing this out and suggesting the fix. Make the handle yet another member of QOCIDriverPrivate so that close() can free it. At the same time, also free the service context handle d->svc when failing do open(); and shuffle the order of frees to be the reverse of the order of allocations. Fixes: QTBUG-94246 Change-Id: I45818ada6d884b06028056d28635390a300e2def Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit c42ebd5ba6f1fb861cabdbe44ab10df55b9b3ada) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: don’t leak QWasmScreen member variablesMorten Sørvig2021-06-222-6/+6
| | | | | | | | | | m_compositor and m_eventTranslator are owned by the screen object and can be held in a unique_ptr. Change-Id: I7d5e19e7ac6f762f360d6af0fc9500e6964f737e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 0ca0f3e7febabba42d4494dc96bc3b5e62841dec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: fix non-void function returnLorn Potter2021-06-221-2/+3
| | | | | | | Change-Id: Ia7ef3367c0531f953c78e43297f67d61b08dbf17 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit d904274176d9b74dfedac1e3827cd2cc97693c41) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xkb.compose: get locale from user env settingsLiang Qi2021-06-211-4/+10
| | | | | | | | | | | | | | The setlocale call will only give useful results if the program had previously set the current locale using setlocale... See also "Compose Locale" section in xkbcommon doc: https://xkbcommon.org/doc/current/group__compose.html#compose-locale Fixes: QTBUG-85529 Change-Id: I65b1ac86ea54445bc3a2e1707df79bd9f732ab46 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 73ea9f032864566cc019d286b2f210b78cd70a3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not apply not acceptable properties to the imported object librariesAlexey Edelev2021-06-211-5/+10
| | | | | | | | | | | | | | If __qt_internal_propagate_object_library is used to propagate an imported object library we assume that the library is already compiled and no need to apply properties that may affect compiling and further linking of the target. Amends 3329212815777e33dfb4697b748d10927d73f44c Change-Id: I2bd03264e286439fbed9067fa2c0a5c4a0097856 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d49f19e66107f6f56271e32284ee952af598ff1b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add note to Qt::MatchFlags about implementation dependent behaviorPaul Wicking2021-06-211-0/+5
| | | | | | | | Fixes: QTBUG-94374 Change-Id: I7f426c92bf0434998d0793eedd405c1a682a28d9 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit c92c3c19e8ba02eeceff882b71571a076bef504d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflow in text layoutEirik Aavitsland2021-06-211-1/+2
| | | | | | | | | | | Fixes oss-fuzz issue 34597. Fixes: QTBUG-94197 Change-Id: Icabcd5a87b809b6a5ae0f1a696ec3b5dd906886b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit e473d96e65e7cf3190c6c16acace6359964d0bee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Porting Guide: Mention that also QSet is affected by stability of referencesKai Köhne2021-06-211-2/+2
| | | | | | | | | | QSet is internally implemented by a QHash. Therefore the change in reference stability affects QSet, too. Change-Id: If1879d5a027211bca0beeff16ffbc77f2f4fce26 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit c2c15666b76516e5edfbe2a51226740b5a0bb4d3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix right-to-left text with DirectWrite engine + QPainterPathEskil Abrahamsen Blomfeldt2021-06-211-1/+2
| | | | | | | | | | | | | | | | | | When QPainterPath was used for RTL text, either directly or because the target text size exceeds 64 pixels, we would pass true for "isRightToLeft" to DirectWrite, causing it to do adaptation internally for this. But the RTL layout had already been handled by Qt, so we would essentially reverse the layout twice and also move the text to negative X coordinates. Passing false instead fixes this, as it will then just use the positions we pass in blindly. Fixes: QTBUG-94175 Change-Id: Ie9a47e56e97fc867ede10ab21ac5e3f003ddcacb Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 30399fb95cf8b528ac4b45766ac55c6f0a16e2f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing limits includeNicolas Fella2021-06-201-0/+1
| | | | | | | | | The code uses std::numeric_limits but is lacking the appropriate include Change-Id: I41fa5ac4d8c4e06f35b5b1551ef2ad8417df80bd Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 2b2b3155d9f6ba1e4f859741468fbc47db09292b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Apple: Use POSIX IPC instead of System V in sandboxed applicationsTor Arne Vestbø2021-06-198-12/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System V semaphores are not supported in sandboxed applications, so when Qt is configured with App Store compliance, or the user requests POSIX IPC explicitly, we use that instead. https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24 As the shared memory name limit on Apple platforms is very low, we have to skip the existing logic for naming, and instead use a truncated hash of the key. This should still be fine for avoiding any collisions in practice. An explicit check for the ENAMETOOLONG error has been added to catch any cases where they key goes beyond the allowed length. Sandboxed applications also have an extra requirement that the key must include an application group identifier. This requirement has been pushed up to the user and documented, as we don't have enough information in Qt to know which identifier to use. Both tst_QSystemSemaphore and tst_QSharedMemory work as before with both sandboxed and non-sandboxed applications, after removing some assumptions in tst_QSharedMemory about System V behavior. Fixes: QTBUG-91130 Change-Id: Iaf1edb36a5d84d69e42ec31471a48d112faa8c6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9661cde1615e21f5b6bbffe3e687cacba247f514) Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QEventDispatcherWin32: suppress old {FD_CLOSE|FD_CONNECT} notificationsAlex Trotsenko2021-06-181-3/+10
| | | | | | | | | | | As with other network events, we must also ignore these notifications until WM_QT_ACTIVATENOTIFIERS message is received. Fixes: QTBUG-82835 Change-Id: I0740bf22e8d1cb0e8b4eba7fc1a27ffe669973ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit fe6d84d96e67113846801803c3ba1f20b26e123f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move the linking logic of the object libraries to a common functionAlexey Edelev2021-06-181-75/+113
| | | | | | | | | | | | | | | | | | | | The linking logic of object libraries should be reusable outside of the resource context. This introduces a __qt_internal_propagate_object_library function that prepares all the necessary genexes to link and propagate the object library to the end-point executable. Rename resource object finalizer API to make the naming more generic to object libraries of any kind. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3329212815777e33dfb4697b748d10927d73f44c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS 11: Fix positioning of focus frame around comboboxVolker Hilsheimer2021-06-181-4/+8
| | | | | | | | Fixes: QTBUG-94069 Change-Id: I09079726c96a41f628ae55724cfe53dbc225d358 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit df316963213e765de5b94469622df48b0c9a9e6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not alter a widget's backing window's format once createdLaszlo Agocs2021-06-181-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing anything on a QWindow's QSurfaceFormat has zero and null effects once the underlying native window has been created. Letting QWidget update the format is wrong in this case, because we always expect that the value returned from QWindow::format() reflects reality. (reality being the settings with which the underlying native resource was created, which is typically frozen after QWindow::create(), not the state of some QWidget attribute. There are certain exceptions to this, such as when preparing to recreate the underlying native window, in which case one will want to update all relevant fields of the format based on the current values of the widget attributes, which is exactly what QWidgetPrivate::create() implements, and that's good.) Such a mismatch can have fatal consequences when OpenGL and friends are involved, but this always depends heavily on the platform and windowing system. For example, claiming that the alpha buffer size is 0 when the native window was created with 8, or vice versa, can break OpenGL-related code (both in Qt itself and in applications), that tries to create a QOpengGLContext configured based on what QWindow::format() returns. If that format describes settings that are incompatible with the actual underlying native window, we end up with the classic Invalid pixel format, EGL_BAD_MATCH, and alike errors. This is exactly what is happening when a QOpenGLWidget (or QQuickWidget) is placed in a QDockWidget where one of the ancestors is forced to native (winId() was called or WA_NativeWindow was set). When undocking, various code paths in QWidget will try to update the opaque flag of the widget, which in turn calls updateIsTranslucent. Now, if this function unconditionally changes the alphaBufferSize in the QWindow's QSurfaceFormat (even though this is completely futile to do, it has no visible effect in practice), we get the problem described above: rendering breaking down due to OpenGL contexts created with a pixel format incompatible with the native window. Prevent all this by not touching the format once the QWindow has a QPlatformWindow. This is the right thing to do, regardless of the bug in question: a window's (or context's or any other native resource wrapping class's) format must describe the underlying native resource and must never deviate, unless we are preparing to create a new native resource underneath. When it comes to the autotest, this changes the test added in 555661b625c40f21a6a3e4c73e928a6e8a46db20: the autotest logic is inverted because what we should test for is that the QSurfaceFormat stays untouched once the application makes a - futile - attribute change on the widget. Fixes: QTBUG-85714 Change-Id: I7bf90711867e8a0fd474895625bf9530a7821fd5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit e6a969954a9e6865e5f662acd1d949561f8ef3be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Move overrideCursor() from QApplication to QGuiApplicationSze Howe Koh2021-06-181-3/+3
| | | | | | | | | The transfer occurred in Qt 5 Change-Id: Id3428809d89c804112d9dc02f2a476cb03bd2c98 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit d254af915241c6ed5a6b590bfa8d27c7488f8a77) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Enable glyph cache workaround for Apple M-family of GPUsTor Arne Vestbø2021-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without the workaround, and when using a Core GL profile, we hit a code path in QSGOpenGLDistanceFieldGlyphCache::resizeTexture() that produced corrupt glyphs on M1 hardware. We fix this by enabling the workaround, so that the user doesn't have to set QT_ENABLE_GLYPH_CACHE_WORKAROUND themselves. None-Core contexts do not have this problem, but the logic in QOpenGLContext does not account for recreated contexts with different formats, so we can't limit the workaround to Core formats only. With the unified memory architecture of the M1 hardware, the workaround should have limited negative effects. In Qt 6 this is not a problem, since Qt Declarative effectively always uses the workaround code-path, but it's worth recording the fact that we need the workaround. Fixes: QTBUG-89379 Change-Id: Icfd8b8b23c0dcda3fea8663d81d0e225134eec5e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit aeeaa7d253239b4b45e419bcad5cfde5c5714080) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove old configure-related filesJoerg Bornemann2021-06-1813-7118/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Task-number: QTBUG-89536 Change-Id: Ie827562f7fd2513d59f69234d77b8b93124ea78e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7155e4f62060c3d9f36e748135bd57776f40b4b2)
* QHash: Fix erase() edge-caseMårten Nordheim2021-06-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | When the element you want to erase is the last element AND the next element (element 0), when rehashed, would be relocated to the last element, this leads to the state below. Which is similar to a test in tst_qhash for some seeds. auto it = hash.begin + (hash.size - 1) it = hash.erase(it) it != hash.end By forcing the iterator to increment if we were erasing the last element we always end up with a pointer which is equal to hash.end Befriend the tst_qhash class so we can set the seed to a known-bad one Change-Id: Ie0b175003a2acb175ef5e3ab5a984e010f65d986 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit ea7d87b5b59ded22b145ecbb4dd648ecfd1abbdd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Porting Guide: Mention deprecation of QLibraryInfo::locationKai Köhne2021-06-181-0/+2
| | | | | | | Change-Id: I998a4575ce7fb56ab51d49715071e682a440360b Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit b26988d0b51ac26867258ced00c465324032b855) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Porting Guide: Mention changed behavior of QCApplication::quit()Kai Köhne2021-06-181-0/+12
| | | | | | | | | Mention change of behavior introduced by 89f7a2759c6b in the porting documentation. Change-Id: I3c282362f5852cc7768e6655fc7b3901d68f2b10 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3cbe11f93475a845e4e7849e1315570ea782e595)
* Fix recursion crash when calling setStyleSheet with `qproperty-styleSheet`Zhang Yu2021-06-181-0/+3
| | | | | | | | | | | | When calling `setStyleSheet` with property `qproperty-styleSheet`, `QStyleSheetStyle::polish` will call`QStyleSheetStyle::setProperties`, and then`QStyleSheetStyle::setProperties` goes on to call `setProperty`.Because there is property `qproperty-styleSheet`, it will update stylesheet by calling QStyleSheetStyle::polish`. This causes the recursive call to crash. Fixes: QTBUG-94448 Change-Id: I79c51192a939b0b62e5b1d0dcc90d38f79e28222 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit e9cdcc7cb314586aec76b8b9979435f0af963443) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QBindable: Use setter in setValue for QObjectCompatPropertyFabian Kosmale2021-06-171-0/+31
| | | | | | | | | | | | | Directly writing to the underlying property storage has the potential of breaking all kinds of internal invariants. As we return QBindable in the public interface, we should not grant callers access to the internals of the object. Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 6b36e783521993df8de6477c789aa26c38803656) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Set the plugin class name for qml pluginsAlexandru Croitor2021-06-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for a change in qtdeclarative to allow building the Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin. Show an error if the qml plugin has no class name, it's needed for plugin initialization so it's mandatory to have a class name. Show an error if a class name is not found when computing the import macro for a plugin (both for a regular qt plugin and a qml plugin). When querying for the class name of a target, query both a Qt6:: prefixed target as well as a non-prefixed one, with the Qt one taking precedence. This is to allow querying the class name of user project created qml plugins. Currently regular qt user plugins don't use the object library initializer approach. This will likely be revisited in the future. Task-number: QTBUG-92933 Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 602d26c38f3767be9bec25302c93fc155c4dce59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Rename qt6_finalize_ios_app to be internalAlexandru Croitor2021-06-171-3/+2
| | | | | | | | | | | | | For now, it's not meant to be called manually. It's called in qt_add_executable automatically for iOS. Amends 4d838dae5a821e9e5f013ba1d5a494ece1b5180e Task-number: QTBUG-88763 Change-Id: I90dfcf86f53a3c8e48a813435f7400db232b21f4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 51b8c81c84136d5e80a803b2248ed1d17ab43ef0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove old add_qt_gui_executable APIAlexandru Croitor2021-06-171-6/+0
| | | | | | | | | | | Repos should have migrated by now and the function should not be advertised as a public one. Task-number: QTBUG-88763 Change-Id: Ica5bc55670a17a28c0022f78c126a3a8a8ffdeb5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 15c5f905072c28537586a070a5320201edeee316) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>