summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Sequential erase/_if: don't apply predicate twice to elementMarc Mutz2022-02-021-25/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was trying to avoid a detach in the case no element needed to be removed, by first running find_if() on const_iterators, and then, after converting its result to (mutable) iterators, start the remove_if() algorithm where find_if() left off. But this applies the predicate to the element found by find_if() (if any) _twice_: first just before we exit the first find_if() and then just as we enter remove_if(), which will start by running find_if() again, with the result of the initial find_if as 'first'. Apart from being needlessly inefficient, this violates the specification of Uniform Erasure, which defines sequential erase_if() as being equivalent to remove_if() + container erase(), with the former being specified to apply the predicate exactly once per element. Fix by writing the remove_if() part by hand. Instead of doing the dance with the loop invariant documentation twice, simply implement erase() via erase_if() (complicated a bit by the weird passing of predicates by lvalue reference instead of by value, as would be idiomatic). This exposes users to: [ChangeLog][QtCore][Potentially Source-Incompatible Changes] A fix in the implementation of the erase-like algorithms of sequential Qt container may re-enable signed/unsigned comparison warnings previously suppressed by having occurred in std library code. To fix, cast the value to look for such that it has the same signedness as the container's elements. ... but the issue would be the same had we inlined std::remove() instead of passing a lambda to sequential_erase_if(), so it's nothing we can, nor should, work around. [ChangeLog][QtCore][Containers] Fixed a bug in the implementation of most sequential Qt container's erase-like algorithms (member removeAll()/removeIf() and free erase()/erase_if()) where the equality operator or the predicate, respectively, was applied to the first matching element twice. Each element is now tested exactly once. Pick-to: 6.3 6.2 Change-Id: Ib6d24b01b40866c125406f1cd6042d4cd083ea0d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QImageReader: Check for existing handler in initHandlerRobert Löhning2022-02-021-3/+6
| | | | | | | | | Some calling code did this beforehand, other didn't. Now, the function itself checks for an existing handler before doing anything else. Change-Id: I8fc43fb8788c9dfe825b15ffa2fa69ee43915cd6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QGuiApplication: invert meaning of qt_is_gui_usedMarc Mutz2022-02-024-9/+9
| | | | | | | | | | | | | | | | | | The default value was true, which is non-zero, forcing the variable out of the BSS and into the DATA segment. Fix by inverting the meaning so the default value can be false. Since qt_is_gui_unused sounds a bit complicated, however, take a cue from the variable's only writer and rename it qt_is_tty_app. Pick-to: 6.3 Change-Id: I198e9786f7e71178d69fecb5179287bf39b3a1d6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qfloat16: add AVX512VL qfloat16 conversion tailThiago Macieira2022-02-011-0/+37
| | | | | | | | Slightly simpler implementation for the tail because of the OpMask support. Change-Id: I60fdef243d0c4e04890dfffd16266facd53d78aa Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QMacStyle::standardIcon - use the real file nameTimur Pocheptsov2022-02-011-1/+1
| | | | | | | | | | | When converting to cmake, aliases from the (now deleted) qstyle.qrc were omitted and now we have to use the original names. Pick-to: 6.3 6.2 Fixes: QTBUG-100317 Change-Id: Ieb83e95c62f10c0e2193602e4c12c5fc1667e15a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move QIOType wrapper for io_object_t to QtCoreTor Arne Vestbø2022-02-013-29/+18
| | | | | | | | | | Since we require C++17 now we can use auto for the retain and release template arguments, which allows us to get rid of the wrapper functions for IOObjectRetain and IOObjectRelease. Pick-to: 6.2 6.3 Change-Id: Ifc4bf0fe50dfd0eaf6bb2e143acce6df7df17bdc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* testlib: Disable window restoration on macOS in a non-persistent wayTor Arne Vestbø2022-02-011-2/+5
| | | | | | | | | | | | | | | | The recommended way to register defaults on macOS is via registerDefaults: which puts the key/value into the volatile NSRegistrationDomain. This stops testlib from dumping preference files into ~/Library/Preferences: ❯ plutil -p tst_qwidget.plist { "ApplePersistenceIgnoreState" => 1 } Pick-to: 6.2 6.3 5.15 Change-Id: I4ac812014f9ff97bc446806eaf2108cd1c8b89c3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* configure: Check for basic cpp/winrt supportOliver Wolff2022-02-013-6/+31
| | | | | | | | | | | | | | Some configurations (like MSVC2019 with c++20 on Windows 10) fail to compile winrt/cpp headers as these include experimental coroutines unconditionally. In these cases we can fall back to the legacy implementation. Pick-to: 6.2 6.3 Change-Id: Ibd574995f8ca1f865bbcdabede1ffcd0c340022f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: State Qt versions for when CMake commands etc. were introducedJoerg Bornemann2022-02-0124-1/+72
| | | | | | | | | | | | | | | | | | | Introduce the qdoc macros \cmakecommandsince, \cmakepropertysince, and \cmakevariablesince that insert a paragraph akin to the \since context command. Example: \cmakecommandsince 6.3 produces the paragraph This command was introduced in Qt 6.3 The macro text is wrapped in \n\n to ensure that we always generate a new paragraph. Pick-to: 6.2 6.3 Task-number: QTBUG-100212 Change-Id: Id5c8e8812e6b0b915674d108a0e775091e9eacd8 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Deduce install prefix of example in qt_internal_add_exampleAlexandru Croitor2022-02-012-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to get rid of the INSTALL_EXAMPLEDIR and INSTALL_EXAMPLESDIR code in each example project. This was an internal workaround to ensure examples are installed into a relative path somewhere under $qt_prefix/examples and not in $qt_prefix/bin or similar. To achieve that we do two things. First, deduce the install prefix for each example in the implementation of qt_internal_add_example (our add_subdirectory wrapper) and assign it to CMAKE_INSTALL_PREFIX before calling add_subdirectory. We need to make sure to remove the default value of CMAKE_INSTALL_PREFIX in the generated cmake_install.cmake file. Second, we set an internal variable called QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT before the add_subdirectory call, which will be checked whenever find_package(Qt6Core) is called in an example project. If the variable is set, the INSTALL_EXAMPLEDIR var is set to "." in the scope of where Qt6Core is found. This ensures that the hardcoded INSTALL_EXAMPLEDIR values in our example projects are changed to ".". With both changes, our example project install(TARGET DESTINATION) calls will now install to "${CMAKE_INSTALL_PREFIX}/examples/${example_relative_dir}/." Once all repositories are updated to use qt_internal_add_example instead of add_subdirectory, we can get rid of the QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT workaround. For repositories that still don't use qt_internal_add_example, the install prefix rewriting will not happen, but the examples will still be installed to the proper place because they use their own hardcoded INSTALL_EXAMPLEDIR value. Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Pick-to: 6.2 6.3 Task-number: QTBUG-96232 Task-number: QTBUG-98545 Change-Id: I78c118e10c41b519c570c7d87529afd15aeed900 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* rhi: d3d11: Switch the default swap effect and scaling modeLaszlo Agocs2022-02-012-26/+48
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtGui][QRhi] With Direct3D 11 the default swap effect is now DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL combined with DXGI_SCALING_NONE. This should provide a better (less "jumpy") resizing experience for Qt Quick content in particular, because the stretch effect for size-mismatched present is not ideal for user interfaces. We'd rather want to keep the size as-is and have the white border on the right/bottom (which we will have anyway, inevitably). This is also closer to what one gets with OpenGL (though that may depend on the driver as well). For Vulkan on Windows, the behavior will remain very similar to what DXGI_SCALING_STRETCH does, depending on the implementation probably, because the Vulkan spec fails to address the handling of scaling modes for size-mismatched presents. To get the old D3D behavior, i.e. FLIP_DISCARD+SCALING_STRETCH, set the environment variable QT_D3D_FLIP_DISCARD to a non-zero value. Pick-to: 6.3 Fixes: QTBUG-99637 Change-Id: Ic8a219fbf3cdb6458b7ec9149bf27e771d9f7ddd Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use IMPORTED_LOCATION of rcc targetAlexey Edelev2022-02-011-7/+30
| | | | | | | | | | | Use IMPORTED_LOCATION of rcc target when generating Android deployment settings, instead of the hardcoded host path. Introduce a helper function to find the location of the imported tool target. Change-Id: Icfa51ee7a01b3f58fc4892da03055f9ed531cc0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* rhi: d3d11: switch to uuidof everywhereLaszlo Agocs2022-02-011-9/+9
| | | | | | | | | | | | | | There seems to be bizarre issues with IID_* as they are not always exported or are in a different library depending on the SDK and where dxguid.lib comes from. If not mistaken, we don't need these symbols at all because in C++ one can use __uuidof instead (which would not be possible in C code and there the IID_ objects are necessary). Pick-to: 6.3 Change-Id: I04712382630768a742bb5f42cc5fca9ad10ff719 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Code quality - remove defaults from switch enumsBen Fletcher2022-02-012-28/+11
| | | | | | | | | | | | | On code review of previous RHI patches it was noted that many switch on enum statements contain a default. This is discouraged as it prevents the compiler from automatically identifying switch statements that do not cover all enum cases. This patch addresses rhi base classes. Further patches required for specific backend implementations. Change-Id: Ib2bb30c66fd214b65a4ca7b787c7c610f3c313f5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QAbstractItemView: do not access invalid model indices (2/N)Giuseppe D'Angelo2022-02-011-0/+2
| | | | | | | | | Similar to the parent patch, the private selectAll() was doing two out of bounds accesses on an empty model. Guard it. Change-Id: If0f3ce1e6c44a152791313e47db79985e71ef955 Pick-to: 5.15 6.2 6.3 Reviewed-by: David Faure <david.faure@kdab.com>
* QAbstractItemView: do not access invalid model indices (1/N)Giuseppe D'Angelo2022-02-011-1/+2
| | | | | | | | | | Calling selectAll() on a view with an empty model, with the view in ContiguousSelection, causes an out of bounds access into the model. Guard the access. Change-Id: I3830a979bad760e9e1526c1c8b12d9767d41fc99 Pick-to: 5.15 6.2 6.3 Reviewed-by: David Faure <david.faure@kdab.com>
* QAbstractItemView: code tidiesGiuseppe D'Angelo2022-02-011-4/+12
| | | | | | | | | In preparation for an upcoming fix, refactor an if over an enumerator to a switch (which is how this code should've been to begin with). Change-Id: I11a2de6d66f0359b985b587b7fd37022a7bf56e6 Pick-to: 5.15 6.2 6.3 Reviewed-by: David Faure <david.faure@kdab.com>
* QCoffPeParser: simplify std::optional checkMarc Mutz2022-02-011-1/+1
| | | | | | | | | | | | | | | | | | | Even in C++98 one could declare variables in if statements and contextually convert them to bool: if (D* d = dynamic_cast<D*>(base)) ~~~ else if (D2* d = dynamic_cast<D2*>(base)) ~~~ std::optional is contextually convertible to bool, so we don't need C++17 if initializers. Just use if (auto optional = ~~~~) Pick-to: 6.3 Change-Id: Ie64c2c1ceb7b608eda0534d837f46d3c4be49bf8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make one QT_REMOVED_SINCE/QT_BUILD_REMOVED_API per moduleMarc Mutz2022-02-0114-61/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single global QT_REMOVED_SINCE will start hurting us once more modules downstream of QtCore start using the mechanism. With every use of feature, the set of code that needs to compile under QT_BUILD_REMOVED_API increases. Since we use QT_REMOVED_SINCE in situations where overloading the new and the old function don't work in general, this means all code included by any removed_api.cpp needs to be very carefully written to ensure that any calls to the overload set formed by the combination of old and new function(s) don't create ambiguities. Likewise, the set of APIs that change semantics under QT_BUILD_REMOVED_API also increases. At some point, the combination of removed_api.cpp including almost every module header and almost every header exposing source-incompatibilities when included in removed_api.cpp will make maintenance a headache. By making QT_REMOVED_SINCE and QT_BUILD_REMOVED_API per-module (QT_CORE_REMOVED_SINCE, ...), easy now that we generate the export macros using CMake, we limit the scope of this problem to the module using the feature. Downstream modules (say, QtWidgets) will now see the QtCore API like every other user, even in the widgets/compat/removed_api.cpp TU. Pick-to: 6.3 Change-Id: I177bc7bd5aa8791639f97946c98e4592d2c7f9d9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTextTable: fix signed/unsigned warningMarc Mutz2022-02-011-1/+1
| | | | | | | | | | | | | | | | | | Even disregarding the warning, we're instantiating QList<int>::removeAll<uint>(), which is wasteful, so cast the fragment to int, like in the indexOf() call a line above. Detected by a rewrite of, essentially, QList::removeAll() as removeIf() + lambda, which brought the comparison from an -isystem header (std::remove()) into Qt code (the lambda), and apparently un-suppressed the warning. Qt 5.15 has the same code, but is unaffected, because removeAll() is no template there. Pick-to: 6.3 6.2 Change-Id: Id9fe33be647fc3dc958e316f0fbe03009b2a7adc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* rhi: d3d11: Try uuidof instead of IID_* to help old MinGWLaszlo Agocs2022-02-011-1/+1
| | | | | | | Fixes: QTBUG-100294 Pick-to: 6.3 Change-Id: Iee90355ecd48a753f9a7ec53e7f5758e3d12eddf Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QWeakPointer: make default ctor constexprMarc Mutz2022-02-011-1/+1
| | | | | | | | | | ... and thereby also QPointer's. Found by applying C++20 constinit around the codebase. Pick-to: 6.3 6.2 Change-Id: I9f149b2346624ca913c29b796f94ac7d24fe560a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QGuiApplication: constant-initialize lastCursorPositionMarc Mutz2022-02-011-2/+2
| | | | | | | | | | | | | Because we used (exported) qInf() to initialize static QPointF QGuiApplicationPrivate::lastCursorPosition, the initialization was done at runtime. Fix by using qt_inf(), which is inline and constexpr. Pick-to: 6.3 6.2 5.15 Change-Id: I8b07c6c8bf1f644eaa88f2f33166045726915725 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Add the basic infrastructure for geometry shader supportBen Fletcher2022-01-319-7/+68
| | | | | | | | | | | | | | | | | | | | | .. but this will only be supported on Vulkan, OpenGL 3.2+, and Open GL ES 3.2+ for the time being. The situation is: - Vulkan is working. qsb accepts .geom files already, and QShader has existing geometry shader support. - OpenGL 3.2 and OpenGL ES 3.2 are working. - D3D11 is not working. D3D11 supports geometry shaders, but SPIRV- Cross does not support translating geometry shaders to HLSL. - Metal is not working. Metal does not directly support geometry shaders. Change-Id: Ieb7c44c58b8be5f2e2197bf5133cf6847e6c132d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: Add support for polygon fill modeBen Fletcher2022-01-318-1/+103
| | | | | | | | | | | | | | | | | Support for Polygon Mode (Triangle Fill Mode in Metal, Fill Mode in D3D) in the RHI graphics pipeline. Options are Fill and Line Status: OpenGL - ok Vulkan - ok Metal - ok D3D11 - ok OpenGL ES - does not support glPolygonMode. Change-Id: I20b7ef416624700c3dc8d1cbe6474f4ca3889db8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QtFuture::connect: fix for signals with a single std::tuple argumentSona Kurazyan2022-01-311-12/+1
| | | | | | | | | | | | | | | | | | | If the signal passed to QtFuture::connect() takes multiple arguments, we need to wrap the arguments in a std::tuple when reporting the result. To detect this case we were checking if the result type of a QFuture returned by QtFuture::connect() is a std::tuple, but this was not correct: the result type could be a std::tuple also if the passed signal takes a single std::tuple argument. Instead, check if the signal takes more than one argument. As a drive-by modified the tst_QFuture::signalConnect to use const values for tuples used in multiple test-cases, to avoid repetition. Fixes: QTBUG-100071 Pick-to: 6.2 6.3 Change-Id: I1ce39cf87028f36ef94a9d1a4423b0c51473afd4 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Bump version to 6.4.0Jani Heikkinen2022-01-313-3/+5
| | | | | Change-Id: Ie0e2133d6c9125b901364c979c60b6efd585f026 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* QNetworkReply: rename socketConnecting to socketStartedConnectingMårten Nordheim2022-01-317-10/+10
| | | | | | | | | From the API review. Pick-to: 6.3 Change-Id: Ic05737db79327e7811fcd974a70914b837e06601 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix misguided winding backwards past start of start of MS TZ dataEdward Welbourne2022-01-301-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | QWinTimeZonePrivate::data()'s search for a rule applicable to a given time, in the first year whose milliseconds qint64 can represent, tries to look at the preceding year to get start-of-year data, which leads to misleading results. It does so to determine whether to use a rule's standard or daylight-saving details, but this year is long before the invention of daylight-saving time, so we can bypass the whole mess. Unfortunately, MS's data does pretend (in some zones) that DST has always been in effect, so cutting off that claim at some historical point will actually get better results for before the cut-off than for the period after it, until the relevant zone actually adopted DST. Conservatively put the cut-off at 1900, before any actual zone used DST, albeit after the idea was originally floated. This fixes a failure found by some QDate::{start,end}OfDay() tests that I want to introduce. Pick-to: 6.3 Task-number: QTBUG-99747 Change-Id: I15cf9dd092b946191e8863c7e85fbeb4ba6c106d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QCalendar: port registry from QHash to QFlatMapMarc Mutz2022-01-301-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike many other uses of QFlatMap, this actually promises to hit the QFlatMap sweet spot, and we're using all its levers. To wit: - Enable lookup via QAnyStringView through a transparent comparator without having to convert the QAnyStringView to QString first. This is impossible with QHash, because qHash() values are not consistent for different string types: u"a"_qsv == "a"_L1, but qHash(u"a"_qsv) != qHash("a"_L1). The relational operators don't have this consistency problem, and they also implement case-insensitive comparison, another thing qHash lacks. - Pick different types of containers for keys and values. For the keys, use QStringList, which makes availableCalendars() trivial and extremely fast. We can reserve() the flat_map to limit the effect of reallocations, because we have a pretty good idea about how many entries we'll have. For the values, use the same container as for byID. This might be better with QVarLengthArray, but that's for another patch. - Fix the double lookup in registerBackendLockHeld() by using try_emplace() instead of contains() + insert(). To enable QFlatMap's full potential, we still need to teach ensurePopulated() to create the two containers for the QFlatMap unordered and let QFlatMap sort them in one go, but that, too, is for another patch. Change-Id: I7fe4f3f7596e9b234696fbc8e467128b85629f8a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Refine QTZP_win's msecsToDate() by trusting arithmeticEdward Welbourne2022-01-301-3/+3
| | | | | | | | | | | | | | | | Division and modulo are guaranteed to be consistent, with the former truncating towards zero, so the latter giving a remainder that either is zero or has the same sign as the numerator. In particular, when the numerator is positive, the remainder is necessarily greater than minus it, so the formerly correct but unilluminating arithmetic necessarily gave the answer one and we can just --jd rather than doing anything cleverer. Assert the fact that ensures this. Pick-to: 6.3 6.2 Change-Id: Ia718bb947192f1fd2eb36549be12d30e4ee03d58 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFlatMap: fix is_transparent detectionMarc Mutz2022-01-301-1/+1
| | | | | | | | | | | | | | Add a level of indirection via void_t such that struct is_transparent {}; works, and not just using is_transparent = <unspecified>; Pick-to: 6.3 Change-Id: I3ca2af6a07e6989dc95abc10fb2d0078a5269e5b Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QFlatMap: remove binary_find()Marc Mutz2022-01-301-50/+28
| | | | | | | | | | | The private binary_find() overload set is literally identical to the public find() one, so cut out the middle man. One less level of function templates to compile. Pick-to: 6.3 Change-Id: Ia7b248d883b7bcff39c4f7b470d2567970572885 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QFlatMap: add full is_transparent support [3/3]: add overloadsMarc Mutz2022-01-301-0/+62
| | | | | | | | | | | Now add the missing overloads for mixed-type lookups, supported by is_transparent Compare objects. Pick-to: 6.3 Change-Id: Ib588b6a4f733d5d9908c8c7d7c209df6e7bd6674 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QCalendar: replace two overloads with one QAnyStringView functionMarc Mutz2022-01-303-11/+16
| | | | | | | | | The backend was already ported, so this is just about applying QT_REMOVED_SINCE and updating the docs. Change-Id: I2c78908deb9cdb3cee19ce8bc148ab3117c1ad9a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFlatMap: add full is_transparent support [2/3]: shuffle functionsMarc Mutz2022-01-291-23/+19
| | | | | | | | | | | Move the do_{remove,take}() functions into the private section, cleaning up after the previous step. Pick-to: 6.3 Change-Id: I3325336458b34e7f376b42bfe68355d93ff4ce70 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* qfloat16/F16C: rewrite the F16C conversion with overlappingThiago Macieira2022-01-281-14/+62
| | | | | | | | We don't have to be completely sequential. It's perfectly fine to overlap loads and stores and this leads to simpler code. Change-Id: I6fcda969a9e9427198bffffd16ce56ebbc948379 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qfloat16: add missing staticThiago Macieira2022-01-281-2/+2
| | | | | | | | | | | | Commit 0df7831d01b03910ae74a432c2a07a29d99fc315 moved these functions into this file, but forgot to add the marker. Drive-by replace Q_DECL_NOEXCEPT with noexcept Pick-to: 6.3 Change-Id: I6fcda969a9e9427198bffffd16ce5543c5fd544e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qsimd/x86: disable the F16C, FMA, and VAES features if AVX is disabledThiago Macieira2022-01-282-5/+5
| | | | | | | | | | | | | | | Those three features can't be used without the VEX prefix, which requires that the OS has enabled saving of the AVX state on context switches (i.e., use XSAVE). The list is automatically maintained by the updated script in OpenDCDiag[1]. I need to update the copy in util/x86simdgen. [1] https://github.com/opendcdiag/opendcdiag/blob/main/framework/scripts/x86simd_generate.pl Pick-to: 6.3 Change-Id: I6fcda969a9e9427198bffffd16ce55193a6cb069 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QVersionNumber: remove the "pure" attribute from commonPrefix()Thiago Macieira2022-01-281-1/+1
| | | | | | | | This function can allocate memory, so it's not pure. Pick-to: 5.15 6.2 6.3 Change-Id: I6fcda969a9e9427198bffffd16ce7fcff3ae021d Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QEvent: initialize the static userEventTypeRegistry constexprlyThiago Macieira2022-01-291-1/+3
| | | | | | | | The {} is the difference. Pick-to: 5.15 6.2 6.3 Change-Id: I6fcda969a9e9427198bffffd16ce8dabd213393e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QString: optimize finding size=1 needles in QLatin1StringsMarc Mutz2022-01-291-0/+13
| | | | | | | | | | | | | Use memchr() if the needle has size() one, and add a fast path in findString(QLatin1String, QStringView) to circumvent the QVLA path. We might want to extend this and use a simple C array for very short needles and (cached?) Boyer-Moore for anything larger. Pick-to: 6.3 Change-Id: I8364ea9f004d537be8a09cc751408d8adb902d13 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFlatMap: add full is_transparent support [1/3]: split functionsMarc Mutz2022-01-291-2/+14
| | | | | | | | | | | | | | | | | | Extract Methods do_foo(iterator) from their respective foo(Key) methods. This is done in order to separate the common code from the code that will differ in the is_transparent overloads. Leave the function bodies where they previously appeared, for easier reviewing. Pick-to: 6.3 Change-Id: I49f41f9121a047df696f39daeaa0a9da6a16dddb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QFlatMap: implement mutable op[] via try_emplace()Marc Mutz2022-01-291-12/+2
| | | | | | | | | De-duplicates code. Pick-to: 6.3 Change-Id: Id7841a0717cd66bd56d489e6d2630e9eeb284316 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* rhi: Fix tessellation support for OpenGLBen Fletcher2022-01-282-7/+11
| | | | | | | | | Added shader stage mapping for tessellation stages. Manual test rhi/tessellation now works for OpenGL. Change-Id: I7906b21e9d6e20883f17729f077dba57aa29f4fd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QCalendar: replace ostream-style qWarning with printf-style oneMarc Mutz2022-01-281-3/+2
| | | | | | | | Saves the <qdebug.h> include and expands to a lot less code. Pick-to: 6.3 6.2 Change-Id: Ic1a0aa707e7c0d4bd54da45a7fcafbf898681b2d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFlatMap: use erase() in remove()Marc Mutz2022-01-281-2/+1
| | | | | | | | | | De-duplicates code. Pick-to: 6.3 6.2 Change-Id: I95d3d6f57c2f3716b8f3f549d1cc2a02cde9e996 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QFlatMap: replace manual const_cast<>s with std::as_constMarc Mutz2022-01-281-9/+7
| | | | | | | | | | | | | | Shorter, because it doesn't need to name the type. As a drive-by, replace all remaining uses of the private full_map_t alias with 'QFlatMap', the class name, which, also in templates, refers to the class, not the class template. Pick-to: 6.3 6.2 Change-Id: Ie3bada43d9d28a84543e8baa8a36c522dff80b9e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QVersionNumber: remove "pure" declaration from fromString()Thiago Macieira2022-01-281-4/+4
| | | | | | | | | | | | | | GCC doesn't like that we modify the contents of passed by pointer in the pure function. Reading the description of this attribute in the GCC manual was ambiguous then, but I can see the GCC maintainers' interpretation. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104243 Fixes: QTBUG-62185 Pick-to: 5.15 6.2 6.3 Change-Id: I6fcda969a9e9427198bffffd16cdf815d059d252 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QCalendar: eradicate Java-style iteratorMarc Mutz2022-01-281-4/+9
| | | | | | | | | | | | | We had QT_NO_JAVA_STYLE_ITERATORS in .qmake.conf, but it was lost in the transition from QMake to CMake, and - plop - they start trickling in again. Pick-to: 6.3 6.2 Change-Id: Ib92937e5fe510aba2aad92809f7a6d5fbae6f3a0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>