summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Replace the syncqt.pl script with syncqt toolAlexey Edelev2022-09-2712-7/+1628
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syncqt.pl adds an extra dependency on perl when building Qt. Modern C++ provides the convenient cross-platform way to access a filesystem and to use regular expressions, so we may replace the perl script with C++ application. The syncqt executable is built at configure time and installed as QtCore tool. It's running at configure time to deliver the required header files for IDE to build a consistent code model and at the build time to keep tracking changes in header files and generate the missing aliases without reconfiguring. 'syncqt' only parses header files from a CMake build tree, so the resulting Qt installation only contains interfacing headers that belong to the platform that Qt is built for. 'sync.profile' files are not used as the 'source of truth' for sync qt procedure anymore, all the necessary information is taken from either CMake files at configure time or from the module header files while parsing them. syncqt.pl is still in place since it's required as fallback solution for a smooth transition to the new syncqt implementation for all qt repositories. This patchset only enables the C++ based syncqt for 'qtbase' repository. From the performance perspective C++ version works faster then perl script, also the configure time is reduced significally on subsequent reconfigurations - up x2 times faster when re-configuring repository, but it also takes time to compile the tool itself the first time. Numbers for qtbase: syncqt.pl syncqt.cpp initial: 0m16,035s 0m20,413s reconfig: 0m6,819s 0m3,725s The syncing procedure can be run separately for each module using <ModuleName>_sync_headers targets. The 'sync_headers' target can be used to sync all the modules at once. Task-number: QTBUG-87480 Task-number: QTBUG-103196 Change-Id: I8c938bcaf88a8713b39bbfd66d9e7ef12b2c3523 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Fix Display.getRealMetrics deprecationSamuel Mira2022-09-273-36/+102
| | | | | | | | | | | | In latest Android versions some functions related with Display metrics were deprecated. This patch changes some instances of that code to use the Resources.getDisplayMetrics or WindowManager.getMaximumWindowMetrics depending on the situation. Fixes: QTBUG-99543 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Id9846efa877f704ef7f58c1b0820ad1527b53f09 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* qassert.h: Include qtcoreexports.hFabian Kosmale2022-09-271-0/+1
| | | | | | | Else we cannot use Q_CORE_EXPORT Change-Id: I2ccb6a6a9abeaad1de8d541224e055f524d6d07b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qtdeprecationmarkers.h: include qcompilerdetection.hFabian Kosmale2022-09-271-0/+1
| | | | | | | Without it, we do not have Q_DECL_DEPRECATED Change-Id: I6b16176446027e0f7da923f16971e903aacc80d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDebug: Support standard strings and string views directlyVille Voutilainen2022-09-272-1/+100
| | | | | | | | | | [ChangeLog][QtCore][QDebug] QDebug now supports printing std::strings and std::string_views (and their wide, u16, and u32 variants) directly. Task-number: QTBUG-96878 Change-Id: I7baf4fe688bfff50580b1cee9417af13949374cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtWidgets: Use remove instead of replaceMate Barany2022-09-271-1/+1
| | | | | | | | | | This commit addresses on of the comments from the review of QTBUG-98434. Use remove instead of replace to delete from the string. Task-number: QTBUG-103100 Change-Id: Ifa00a9bae24767eb42d6fa5da0ffdbaa230d5d96 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix condition that runs the scanning of the Qml importsAlexey Edelev2022-09-271-1/+1
| | | | | | | | | | | Scanning of the Qml imports should be run if either Qml root paths or .qrc files are specified for androiddeployqt. Task-number: QTBUG-106939 Pick-to: 6.2 6.4 Change-Id: I3229ec6d3f2ac17ef751b4a6ed74e8e98db7465e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* moc: Add basic support for nested inline namespacesFabian Kosmale2022-09-261-0/+6
| | | | | | | | | | | | | | | This improves moc's support for nested inline namespaces, so that code containing them will not break compilation. For simplicity, we allow nested inline namespaces even in C++17 mode (the actual C++ compiler will reject the code anyway, and probably with a better error message than moc could output). moc still has no real awareness how inline namespaces work, but that is a preexisting issue. Pick-to: 6.4 6.2 Fixes: QTBUG-106920 Change-Id: I7b415a99133575f101bc81d01d4670a5f752917f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Include QVariantPair in documentation of QMetaType::TypeEdward Welbourne2022-09-262-1/+2
| | | | | | | | | | | | | | | When it was added, along with the type it describes, it wasn't added to the QDoc-only fake version of Type's declaration, or to the \enum's list of \value entries. There being no clear reason for those omissions, I'm presuming to guess they were just an oversight. This amends commit c7ce1bc05c1ec2f63dd2531f23a3e9f6fe866556 which was included in Qt 6.0.0. Pick-to: 6.2 6.4 Change-Id: I1bf9fe0f0a31219a888666550a197e479d8eadc1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clear two pointless entries from the QDoc-only QMetaType::TypeEdward Welbourne2022-09-262-4/+2
| | | | | | | | | | | The real Type has several "administrative" members beside LastCoreType and LastGuiType, but only these two appear in the qdoc-only fake version of Type, only to be \omitvalue'd out in the docs. Save the perpetual "need" to keep updating them with each new addition (they weren't even in sync with the real versions anyway) by removing them. Change-Id: If7c5da87655a2da5c7f29f394c9dd9921ff0c1a7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCryptographicHash: implement OpenSSL 3.0 supportJan Grulich2022-09-264-77/+174
| | | | | | | | | | | | | | | Use OpenSSL 3.0 as a provider of all hashing algorithms, except the BLAKE2b and BLAKE2s. BLAKE2b and BLAKE2s algorithms support a variable length digest, but OpenSSL's implementation outputs only a digest of a fixed length (the maximum length supported). This is 512-bits for the BLAKE2b and 256-bits for the BLAKE2s and for that reason we still use the original implementation. [ChangeLog][QtCore][QCryptographicHash] Uses the OpenSSL 3.0 implementation now, where available. Change-Id: Ia4e4139b92ea9b40a18aa480aa5c06562178f916 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Mark QTimeZone's copy-constructor noexceptEdward Welbourne2022-09-262-2/+2
| | | | | | | | | This appears to have been overlooked. It's just the copy-construction of a QSharedDataPointer, which is declared noexcept, so transparently safe. Change-Id: I85e1f750be26dfa94d52dfc0b14efe9c1857d645 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Update version names on QSysInfo and QOperatingSystemVersionAssam Boudjelthia2022-09-263-59/+95
| | | | | | | | Add latest versions that were missing in QOperatingSystemVersion and the version names used with QSysInfo::prettyProductName(). Change-Id: I933158898f9ec39f1c224e15fd6456b7e0546a67 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QtWidgets: Use C string literals as keysMate Barany2022-09-261-21/+21
| | | | | | | | | | | | | Addressing a comment from the review of QTBUG-98434. QSettings has been already ported to use QAnyStringView keys so use C literals to call beginGroup, setValue and value. Since the constructor of QSettings does not have an overload for latin1 strings, change the calls to use u""_s instead of _L1. Task-number: QTBUG-103100 Change-Id: I9407ac8cf9d4c6f045a774b2abe7541086401b07 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qCompress: use saturation, not truncation, for the size headerMarc Mutz2022-09-262-1/+31
| | | | | | | | | | | | This provides a better size hint than the pseudo-random mod 4GiB number used before. In particular, it will make the Qt 5 implementation fail fast, because UINT_MAX will be recognized as a non-representable size right away. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104972 Change-Id: I6010f558eb71bbf02fb0f71bee1b3b1a15ec6e3f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qCompress: return null, not empty, for OOMMarc Mutz2022-09-261-3/+2
| | | | | | | | | | | | | | | | | While this is a behavior change, we never documented that we'd return an empty instead of a null QByteArray in this situation. Indeed, returning bazip, with its fully-preserved capacity, is an expensive way of signalling an error condition. Conclude that this is not what the original author wanted and return a default-constructed byte array instead, leaving bazip and its excess capacity to be destroyed before the return from the function. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104972 Task-number: QTBUG-106542 Change-Id: I2ee1fc6fdbb9da28f1987b16915516b51bb348c3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update url to IAccessible2 SpecificationJan Arve Sæther2022-09-261-1/+1
| | | | | | | | (The old one was 404 page not found) Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I06818443a1f89709b749ea66c05b4023e33b15d0 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* vulkan: Add flag to opt out from enumerating Portability phys.devicesLaszlo Agocs2022-09-263-6/+12
| | | | | | Task-number: QTBUG-106912 Change-Id: I1cb4adae4bed62f31d781a89a03b70885411f91f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* vulkan: Re-enable VK_KHR_portability driversLaszlo Agocs2022-09-263-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Vulkan loader as of SDK 1.3.216 and MoltenVK decided that all existing applications need to stop working with non-conformant Vulkan implementations such as MoltenVK, unless they start specifying the right soup of instance flags, extensions, and device extensions. Set VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR in VkInstanceCreateInfo::flags. Automatically request VK_KHR_portability_enumeration, if supported, on the instance. This handles the instance side. On the device side we can add support in QRhi so Qt Quick continues to work with MoltenVK. This involves requesting VK_KHR_portability_subset on the device whenever the extension is reported as supported (not doing so would be an error) However, applications creating their own VkDevice will need to take care of this themselves. This device extension requires VK_KHR_get_physical_device_properties2 on the instance (which QRhi does not control). This is no problem with Qt Quick as that already does this automatically, but in the unlikely case of wrapping an existing VkInstance in QVulkanInstance it will be up to the creator of VkInstance to enable that as well. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-106912 Change-Id: Idaf277549b3ec982e99bfc49e4ad6a67976c141a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QtWidgets: Use strcmp instead of equality operatorMate Barany2022-09-263-9/+3
| | | | | | | | | | Addressing some findings from the review of QTBUG-98434, use strcmp instead of the equality operator. This saves one strlen() per QL1SV constructor and takes L1 out of the picture. Task-number: QTBUG-103100 Change-Id: Iffe8ce4c4dd9a3ee590d4bb8a14b950241b835e2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Doc: Fix typo in QFileDialog documentationKai Köhne2022-09-261-1/+1
| | | | | | | | Fix typo introduced in 9cd3ff2bdea Pick-to: 6.2 6.4 Change-Id: I248779c06fff81aaea1ef8f0a3a412cfb7cfc0bc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* qdbusxml2cpp: Modify return valuesMate Barany2022-09-241-3/+3
| | | | | | | | | | Addressing a comment from the review of QTBUG-98434. Instead of creating a QL1SV from the concatenation, create the QL1SV first and concatenate after, using QStringBuilder. Task-number: QTBUG-103100 Change-Id: Ic082da410db15dd9e2c341711c24150d7a0dc0c2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix build without opengl featureAlexey Edelev2022-09-244-9/+19
| | | | | | | | | | Guard private includes of private opengl headers and make public opengl headers available even if feature is disabled, since they can be used by user projects. Task-number: QTBUG-103196 Change-Id: If492c97b5cfb21d8aac0d607bc7add38b6d0c73e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* iOS: send control keys to Qt, even if IM is enabledRichard Moe Gustavsen2022-09-241-22/+31
| | | | | | | | | | | | | | | | | Perhaps dating as far back as 829e421ddcd5e8f (Qt 5.8), using the arrow keys on a bluetooth keyboard to navigate the cursor around in a TextArea/QTextEdit has been broken. Some work was done to remedy this with 15576c9610 (Qt 6.1) it seems, but still, using the arrow keys is broken in 5.15, 6.2 and dev. This patch will ensure that we send control key events, such as Qt::Key_Up and Qt::Key_Down, to Qt, also when the focus object accepts Input Methods. Fixes: QTBUG-101339 Pick-to: 6.4 6.2 5.15 Change-Id: I2d12438a822a607646080ab2edb17de8ea6d337c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qdbusxml2cpp: Drop extra QString()Mate Barany2022-09-241-1/+1
| | | | | | | | | | This commit addresses a comment from the review of QTBUG-98434. Drop the extra QString(), .arg can be called on _L1 as well. Task-number: QTBUG-103100 Change-Id: I4891d42536f6ea413464bea78de4b82aa6363a11 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix native titlebar offset and resizing upon unplugging dock widgetsAxel Spoerl2022-09-242-3/+22
| | | | | | | | | | | | | | | | | | | | | | | When a dock widget received a native title bar upon unplugging, the position of the newly unplugged dock widget was calculated without taking the title bar's height into consideration. Furthermore, dock widgets grew by the separator size upon undocking. That is fixed by 10a143ccd762c810f4096a5b2e986d16ea0107ad by relying on the assumption that passing a QRect() to the unplugging method leads to un unchanged dock widget geometry. However, when more than one dock widgets are docked in the same main window dock on macOS or Windows, the size is stil increased. This patch corrects the position offset for native title bars. It also corrects an unplugged dock widget's geometry by the sparator's size. Fixes: QTBUG-106530 Fixes: QTBUG-106531 Pick-to: 6.4 6.2 5.15 Change-Id: Ia4bcb556841e14146f19c1377f4010d5ae009bcf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Propagate appearance property from QPlatformTheme to QStyleHintsAxel Spoerl2022-09-246-20/+107
| | | | | | | | | | | Implement appearance property, getter and notifier in QStyleHints. Update appearance property in QStyleHints when handling theme change in QGuiApplicationPrivate. Task-number: QTBUG-106381 Change-Id: Idd67ca9df248ec9d9e67c0d48121e8eead11a9e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qdbusxml2cpp: Remove unnecessary linesMate Barany2022-09-241-2/+2
| | | | | | | | | | Noticed during the review of QTBUG-98434. The variable includeGuard is a QString, that is converted into a Latin1 string and then converted back to QString. Remove these unnecessary lines. Task-number: QTBUG-103100 Change-Id: I335d49ef990cb6de24031be380b5c2c7e12e961e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Rename QHoverEvent ctor pos argument to scenePosShawn Rutledge2022-09-232-5/+5
| | | | | | | | | | | | | | | | | | | | | | | The QHoverEvent ctor takes two points: scenePos and globalPos; the first of those is passed to the QSinglePointEvent ctor as _both_ the local and scene pos, which calls QMutableEventPoint::setScenePosition() on the persistent QEventPoint instance, and then detaches before setting ephemeral state. Therefore, we must construct QHoverEvent with scene position, not local position, so that the right value is persisted. To localize a QHoverEvent during delivery, use QMutableEventPoint::setPosition(). This needs to be done repeatedly while visiting multiple widgets or items; the detach() prevents it from being saved in the persistent QEventPoint in QPointingDevicePrivate::EventPointMap. Amends 0a64a044b6c1c44b0a2bb2be5e70fda920f5f6bf Task-number: QTBUG-35409 Task-number: QTBUG-100324 Change-Id: Ic1084e1c3cd384683666ba52fe34f16b9d039877 Pick-to: 6.4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qUn/Compress: reject negative lengthsMarc Mutz2022-09-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In qCompress, we've been calculating postive len values out of them, only to fail at random points later, possibly running into UB. Fail early instead. In qUncompress, we've been catching negative values, and reported them indiscriminately as "invalid data". Use a better warning message instead. By rights, nbytes ≥ 0 would be a precondition of both functions (which we would Q_ASSERT() on), but seeing we're picking this back into LTS branches, I found it prudent to use a non-fatal way to signal the precondition violation. If and when we keep these functions for Qt 7, it will be as an overload that takes QByteArrayView, in which case nbytes ≥ 0 enters as a hard precondition via the QByteArrayView constructor, so there appears to be no need to pre-program a Q_ASSERT() for Qt 7.0. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104972 Task-number: QTBUG-106542 Change-Id: I6a1b25fe12d31e3d4c845033cad320832976f83c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qUncompress(): introduce more functions a la invalidCompressedData()Marc Mutz2022-09-231-23/+49
| | | | | | | | | | | | | | | | | | | | | | | ... and use them consistently instead of naked qWarning()s. As a drive-by, fix the warnings we generate on failures, which all-too-often was "invalid data". Code for minimal size by DRYing what the compiler can't, and using Q_DECL_COLD_FUNCTION to avoid excessive inlining. Left the one qWarning() in qCompress(), for now, because that would have changed the return value from an empty to a null byte array. Move invalidCompressedData() to where the others are defined, too, because it's required by a follow-up commit. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104972 Change-Id: Ia43aa315960b06530e98c1d7525ccf0e7f71bb5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Revert "QTextLayout: fix maximumWidth() for a text containing line separator"Eskil Abrahamsen Blomfeldt2022-09-233-12/+1
| | | | | | | | | | | | | | | | This reverts commit 013c346a8dcbd618febb07884c64c740daf9754d. It was determined to cause a regression in Qt Quick: QTBUG-106899. In order to unblock integrations, we need to revert the change. It can be re-committed later when the problem has been analyzed and addressed. Pick-to: 6.2 6.4 Fixes: QTBUG-106899 Task-number: QTBUG-89557 Task-number: QTBUG-104986 Change-Id: I04054587f68ab39fdb038b02fc69ebfa3dc7d197 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* iOS, input panel: be more careful before enabling QIOSKeyboardListenerRichard Moe Gustavsen2022-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation would assume that if we get a UIKeyboardWillShowNotification, the keyboard is about to show, and we should therefore enable the gesture. This is problematic on an iPad with a hardware keyboard connected, because we do actually get get a UIKeyboardWillShowNotification on startup, even when the standard input panel is not showing. From speculation, this is probably because there is a little floating menu at the bottom of the screen that lets you start dictation mode. And in UIKit, this is probably implemented as a UIKeyboard. This new input panel has a zero size, according to the UIKeyboardFrameEndUserInfoKey key in the notification. This means that we can still trust our own implementation of QIOSInputContext::isInputPanelVisible() to be false when a hardware keyboard is connected. This patch will therefore only enable the gesture if we understand the input panel to be visible, rather than automatically assume that it is based on the UIKeyboardWillShowNotification alone. This will also stop the assert inside touchesBegan from triggering. Fixes: QTBUG-106387 Pick-to: 6.4 6.2 5.15 Change-Id: Ia3d27864325b6efb49f03fb20b711979f2d07fbf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Return the actual modal window in QGuiApplicationPrivate::isWindowBlockedMikolaj Boc2022-09-231-1/+1
| | | | | | | | | | | | | The method erroneously returns the common ancestor of the |window| in question and a modal window in case of window-modality of the modal window. What should be returned is the modal window because it is the one that blocks the |window|. Fixes: QTBUG-106627 Change-Id: Ib4da6c1e9757629bbedbd8a16407cd6b5b0d5d27 Pick-to: 6.4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qdbusxml2cpp: Fix mismatches between strings and string literalsMate Barany2022-09-231-7/+6
| | | | | | | | | | Addressing some remarks made during the review of QTBUG-98434. Fix the mismatches between strings and string literals. Task-number: QTBUG-103100 Change-Id: I3a7d2574f55fcffa81b8c87fb510aba0a8853330 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* CMake: Add finalization to plugins created with qt_add_pluginJoerg Bornemann2022-09-233-0/+34
| | | | | | | | | | | | Add the MANUAL_FINALIZATION option to qt_add_plugin and run qt_finalize_target like we do for qt_add_executable and qt_add_library. Currently, the only user-visible effect is that resource files are put into a FOLDER and not underneath a XXX_other_files target. Change-Id: I430d87b5357f6d2ed7fe32198a73eb919f393dd8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtWidgets: Fix mismatches between string types and literalsMate Barany2022-09-233-6/+6
| | | | | | | | | To address some findings from the review of QTBUG-98434, fix type mismatches between strings and string literals in QtWidgets. Task-number: QTBUG-103100 Change-Id: Ie4543d49ddfba382183c5d43df067694f5da53c7 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Introduce centralized means of checking for asyncifyMikolaj Boc2022-09-233-15/+16
| | | | | | | | The new function has an advantage of not requring EM_JS. Change-Id: Ib9ad0e6b59cfe2e6864697a14b5cfdb39f62af2d Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Windows QPA: remove two unused forward declared structsYuhang Zhao2022-09-231-3/+0
| | | | | | | | They are not used, so just remove them. Pick-to: 6.4 Change-Id: I9b92ef97df85a1ab975bf6b6d460b5427135c301 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWindowsKeyMapper: make one variable constYuhang Zhao2022-09-231-1/+1
| | | | | | | It won't change, so make it const. Change-Id: I7ac828baca5340125be2d095ddfa69900543f002 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFlags: Mark the operators declared in macro maybe_unusedMårten Nordheim2022-09-231-0/+9
| | | | | | | | | | | Because, when used in a .cpp file, the compiler can verify that they are. With warnings-are-errors this breaks compilation for me on windows with clang++. Pick-to: 6.2 6.4 Change-Id: Ib29c3b0b485be2c7d7cf6f1fa4541cac8fe32708 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: Mark the mixed enum operator declared in macro maybe_unusedMårten Nordheim2022-09-231-0/+1
| | | | | | | | | Because, when used in a .cpp file, the compiler can verify that it is. With warnings-are-errors this can break compilation. Pick-to: 6.4 6.2 Change-Id: I2c403d914fca24158dba93f618476521cbcfe39f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Optimize the default null QShaderLaszlo Agocs2022-09-221-33/+76
| | | | | | | To please qmlbench. 441->463 in delegates_shadereffect.qml Change-Id: I66bbfd7747df958963a4ebf588a1461edc5dce59 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QMetaType of non-const ref: play nice with template instantiationsFabian Kosmale2022-09-221-1/+6
| | | | | | | | | | | | | ...by making QMetaTypeId2 contain all expected members. While we don't allow QMetaType from non-const references, we want to get to the static_assert telling us as much, instead of running into more or less incomprehensible error messages in the depths of qmetatype.h. Pick-to: 6.4 Task-number: QTBUG-106672 Change-Id: Ica9b13fee95eda97cafab2cccdc5249dfc3dcdf2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Reduce foldCasing of the needle in Boyer-Moore QString searchesØystein Heskestad2022-09-221-10/+31
| | | | | | | | | | | | | | | | | | | | | Before searching, foldCase the first up to 256 characters, and use this buffer to compare against the haystack. If the needle is larger than the buffer, compare the rest of the needle against the rest of the haystack for every potential match. The buffer is placed on the stack and must be refolded for each search, but this change does not break the API. This is faster than the old implementation, except if the needle is long and it is found near the beginning of the haystack, or if the needle is long and it is not found in a short haystack where few comparisons are done and hence few case foldings were needed in the old implementation. Benchmarking using tst_bench_qstringtokenizer tokenize_qstring_qstring shows an improvement for the the total testcase and usually for each individual test. Fixes: QTBUG-100239 Change-Id: Ie61342eb5c19f32de3c1ba0a51dbb0db503bdf3a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtGui: Replace QStringLiteral("...").arg with "..."_L1.argMate Barany2022-09-221-1/+1
| | | | | | | | | | | This commit addresses a comment from the review of QTBUG-98434. QL1S has its own arg()s, replace QStringLiteral("...").arg with "..."_L1.arg. Task-number: QTBUG-103100 Change-Id: I5313783e36101a9a65c7d5a2344ca46614658b80 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Add QTest::currentTestResolved() and use in testlibEdward Welbourne2022-09-223-6/+27
| | | | | | | | | | | | | | | | | | The QTRY_* macros and QTestEventLoop have (since 6.3) been exiting their loops early if the test has failed. Where that was appropriate, they should also have been exiting early on skip. [ChangeLog][QtTest] Added QTest::currentTestResolved(), which is true if the test has failed or skipped. The QTRY_*() macros and QTestEventLoop now use this, rather than QTest::currentTestFailed(), to test whether they should stop looping, so that they also do so on a skip. Task-number: QTBUG-104441 Change-Id: Ibf3d5a095b35e6670bc3daf756f05b66f7f3ef9b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* QNetworkReply: honor legacy behavior of setting Accept-EncodingMårten Nordheim2022-09-221-1/+6
| | | | | | | | | And don't decompress the data Pick-to: 6.4 Fixes: QTBUG-106689 Change-Id: I93a96be8178e24ff0b0bb8647276828161445cf5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QDoc-ify QTest::runningTest()'s commentEdward Welbourne2022-09-221-1/+3
| | | | | | | | | | | While it's being picked into 6.3, it's not present in 6.3.[01], so I've left it out of QDoc's sight (even though it's still \internal) for the version picked to 6.3, but let's include it in internal docs as "from 6.4" since that's the first minor release to contain it. Pick-to: 6.4 Change-Id: I1704a1ca4ba1231d0213e9ca236ef8401a59ddd0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Skip early return from test loops during cleanup()Edward Welbourne2022-09-223-6/+22
| | | | | | | | | | | | | | | | The QTRY_* macros and QTestEventLoop exit early if the test has resolved; however, in the cleanup phase of a test, even if the test has failed, these loops should continue as normal. [ChangeLog][QtTest] During the cleanup() phase of a test, the QTRY_* macros and QTestEventLoop now ignore the test resolution, in contrast to when they are used from the test itself, which (since 6.3.0) exits the loops early if the test has failed. Pick-to: 6.4 6.3 Fixes: QTBUG-104441 Change-Id: I2673161967cbbc57815155af698a9338ab98a686 Reviewed-by: Jason McDonald <macadder1@gmail.com>