summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* QHash: fix iteration of x86 AES hash code for len >= 32Thiago Macieira2022-01-211-2/+2
| | | | | | | | | | | | | | [ChangeLog][QtCore][QHash] Fixed a bug in the qHashBits() function, which affected the hashing of QByteArray, QString (and their View classes), QLatin1String and QBitArray, which caused the hash to not include the final 32 bytes of the data source. As a result, QHash containers where the initial string was the same had a serious performance degradation on x86 CPUs with AES support. Fixes: QTBUG-91739 Pick-to: 6.2.3 6.2 6.3 Change-Id: Icad7c1bad46a449c8e8afffd16cb74dd43440f6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QHash: improve aeshash's page detection codeThiago Macieira2022-01-211-5/+5
| | | | | | | | | | | We don't need to test for actually crossing a page boundary. It suffices to check if we're in the upper half or the lower half of the page. In the upper half, we load ending at the end; in the lower half, we load starting at the current position. This way, it can never crash. Pick-to: 6.2.3 6.2 6.3 Change-Id: Icad7c1bad46a449c8e8afffd16cb743e622b3405 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QStaticByteArrayMatcher: add a useful commentMarc Mutz2022-01-211-0/+1
| | | | | | | | | Took me a few seconds to figure this out, and I'm the author of the class, so leave a comment for my future self (and anyone else). Pick-to: 6.3 6.2 5.15 Change-Id: I65a7aa6f8abf9d671f7d9ba45400f19e0f46728f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use Q_INT64_C() to express qint64 constantsEdward Welbourne2022-01-211-3/+3
| | | | | | | | | | | When int is 32-bit, 0x80000000L is int-min, and (consequently) negating it makes no difference, so MSVC warns about this. Instead of using an L suffix, wrap the constant in Q_INT64_C(). Do the same for similar large constants in the same block. Pick-to: 6.2 6.3 Change-Id: Ib371b932792f170ab7db2e472a4283df3a205af3 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QStringConverter: use QStaticByteArrayMatcherMarc Mutz2022-01-211-2/+5
| | | | | | | | | | | | The Boyer-Moore tables can be calculated at compile-time, and the needles are long enough to make skipping worthwhile, even for small haystacks. Pick-to: 6.3 Change-Id: I3237812490367ed0491eb8d1667c6da67f38c517 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>
* QByteArrayMatcher users: use the new QByteArrayView overloadsMarc Mutz2022-01-212-4/+4
| | | | | | | | | | The new overloads mean that when passing QByteArrayView or QLatin1String objects, we don't expand them into .data() and .size() anymore. Pick-to: 6.3 Change-Id: I0c898e0463d0bf81ce1f7d57e10e64f23bd84587 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* qmake: Allow using Windows 10 API in MinGW qmake internal projectsAlexandru Croitor2022-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to build qt3d examples with qmake and MinGW in the CI, compilation would fail with errors like In file included from C:/MINGW1120/mingw64/x86_64-w64-mingw32/include/windows.h:72, from C:\Users\qt\work\qt\qt3d\examples\qt3d\simple-cpp\main.cpp:63 include/winuser.h:2965:72: error: 'POINTER_INPUT_TYPE' was not declared in this scope What happens is that calling qmake on examples.pro loads qt3d/.qmake.conf, which then loads qt_build_config.prf which then defines the following definitions: mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601 This limits usage of Windows API up to Windows 7, with later APIs being unavailable. Most .qmake.conf files were removed in qt repos, but We didn't remove the .qmake.conf file (fb656c036db0549180073e133773862d08f6cd24) for qt3d because it's supposed to be buildable with CMake + Qt 6 as well as qmake + Qt 5. Bump the defines to the same Windows 10 version we use everywhere else when building with CMake. Amends 6652bf2353d807f724f398a15cb22c188830f57c Relates to d57a7c41712f8627a462d893329dc3f0dbb52d32 Relates to fb656c036db0549180073e133773862d08f6cd24 Pick-to: 6.2 6.3 Task-number: COIN-762 Task-number: QTBUG-92271 Change-Id: I833dfb6b0832d90a76d05ea14cd3807cb0d67ca9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Don't set CMAKE_AUTORCC in pro2cmake.pyJoerg Bornemann2022-01-211-1/+0
| | | | | | | | | To tool generates calls to qt6_add_resources instead, and we don't want to promote the usage of CMAKE_AUTORCC. Task-number: QTBUG-87643 Change-Id: I58458416514949a6ffc9b93c7eb6d24bc2ed01ca Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Fix exception with newer pyparsing moduleJoerg Bornemann2022-01-211-3/+8
| | | | | | | | The pyparsing module's debug action properties have been renamed. Check the existence of the attributes before assigning. Change-Id: I8fff652304a0af215c56f54b63d613a1f6a5207a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove flaky and duplicate animateClick testsVolker Hilsheimer2022-01-212-30/+0
| | | | | | | | | | | | | | The animateClick method is a QAbstractButton member, and neither QCommandLinkButton nor QPushButton override it. The method is tested in the QAbstractButton test, and 3a9b7d1f18648d7236664d3adfc65c009b01e668 made that test more robust. The previous, flaky version of the test was almost duplicated here. They add no additional code coverage, so remove them. Pick-to: 6.2 6.3 Change-Id: I1fa988c1eabd5054193acb1f5fa1c81d29b3878d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Add a note for making ResultStoreBase's internal members privateSona Kurazyan2022-01-211-1/+2
| | | | | | | | | | | There's no class inheriting from ResultStoreBase (and likely won't be), so the destructor was marked to be made non-virtual in Qt 7. For the same reason, the internal members don't need to be protected, and the class shouldn't have "Base" in its name. Add a note about it. Task-number: QTBUG-99883 Change-Id: I00d7a96d99d2c326d29bd421235a15d68b4d4e5c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Tidy up tst_Warnings: comments and #if-eryEdward Welbourne2022-01-211-3/+9
| | | | | | | | | It was missing #if-ery on feature regularexpression for one test that depends on it. One of its comments had a long line. Added some annotations to make clear what's going on in messier tests. Change-Id: I06d8748a134591f93b36029713e52ffd826a24dc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Support overriding CMAKE_BUILD_TYPE per-repo or testJoerg Bornemann2022-01-213-7/+53
| | | | | | | | | | | | | | | | | | | | | One might want to build qtbase in Release, but qtsvg or some test in Debug mode. Before if qtbase was configured as Release, there was no way to override that. Now we try to detect whether a custom build type was specified to qt-cmake / qt-configure-module / qt-cmake-standalone-test / qt-internal-configure-tests Note mixing won't work on Windows due to different C/C++ runtimes. Also, now we don't force set a single build type when a multi config generator is used as well as one opts out via the QT_NO_FORCE_SET_CMAKE_BUILD_TYPE variable. Pick-to: 6.2 6.3 Change-Id: I6dc4325087ff7f905ad677d87b0267e2f3e4693f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Display CMAKE_BUILD_TYPE when including QtSetupAlexandru Croitor2022-01-211-0/+2
| | | | | | | | | | This will show the CMAKE_BUILD_TYPE that was computed for a configured repo or standalone tests, after the logic in QtBuildInternalsExtra.cmake is executed. Pick-to: 6.2 6.3 Change-Id: Ib8ffa2c7806a4c16385a2fcd4500f8a0f6a9aa88 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QArrayDataPointer: don't overload qSwap(), provide ADL-swap()Marc Mutz2022-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qSwap() is our wrapper around using std::swap; swap(lhs, rhs); it needn't and shouldn't be overloaded. ADL swap() should be, though, so qSwap(), std::ranges::swap() and all the other adl_swap()s out there all find the optimized version. Qt 5.15 has it correct, Qt 6 wrong. Fix it. Can't pick to 6.2 because, while backwards-source-compatible, because the generic qSwap() template provides the name for both qualified and unqualified calls, it's not forwards-source-compatible: A new user of ADL swap // compile error w/o `using std::swap`, pessimization otherwise: swap(dp1, dp2); would break or performance-regress when going back to an older version. Pick-to: 6.3 Change-Id: I725949a4aa9ae438a182b4b7552ff2dced767e2f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Conan: use settings.build_type if not set by Qt options for the buildIikka Eklund2022-01-211-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make the Qt conan package consumption more seamless for consumers who use e.g. conan-center packages we should try to make sure that "the default conan build profiles" people are using should work with Qt conan packages as well. This means that we should support the use case that when consumers are not explicitly defining Qt specific build options, e.g. -o debug_and_release=True And the consumer build profiles/settings may contain e.g. [settings] ... build_type=RelWithDebInfo In qtbase conan recipe this should translate to correct 'Options' specific to Qt's configure(.bat). This change introduces a fallback in case Qt specific options are not being passed. It sets the Qt specific options based on the settings.build_type. Pick-to: 6.2 6.3 Task-number: QTBUG-99571 Change-Id: I961570a100fadc03b8c423dcf0064ccc4be7ae6e Reviewed-by: Toni Saario <toni.saario@qt.io>
* Conan: Align binary option values with conan-center recipesIikka Eklund2022-01-211-45/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recipes in conan-center use True/False option values for common binary options, for example: - shared - release Currently the binary option values for Qt recipes use 'yes'/'no' values which makes the consumption of Qt conan packages suboptimal. Example: $ conan install .. -o qtbase:shared=yes -o shared=True After the change one can use: $ conan install .. -o shared=True The shared=True is applied to all packages in the dependency tree including Qt now. Adjust how the booleaness is checked for Conan options which are wrapped with PackageOptionValue. Pick-to: 6.2 6.3 Task-number: QTBUG-99558 Change-Id: I52e16d76418ac3c3e9d653e77287ae89248675d7 Reviewed-by: Toni Saario <toni.saario@qt.io>
* Add QRadioButton test in tst_baseline_widgetsAxel Spoerl2022-01-211-0/+70
| | | | | | | Task-number: QTBUG-99749 Pick-to: 6.3 Change-Id: I89e759e0943b0d1793728a65bfbae6e6b4d3167a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Prevent repeated instantiations of some qRegisterNormalizedMetaType<>s [1/N] ↵Marc Mutz2022-01-2133-33/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (QtGui) Create macros that wrap the magic developed in 7d63efc16f65f98c657caa90e0d7e9b72a879ade and apply it to all Q_DECLARE_METATYPE invocations that show up in Clang -ftime-trace for a PCH'ed QtGui build. Effects on compile times: Clang 10 -ftme-trace: $ ClangBuildAnalyzer --analyze qtgui-before.trace | head -n6 Analyzing build trace from 'qtgui-before.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 628.3 s Codegen & opts (backend): 304.5 s $ ClangBuildAnalyzer --analyze qtgui-after.trace | head -n6 Analyzing build trace from 'qtgui-after.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 546.0 s Codegen & opts (backend): 304.4 s GCC 11 time (bash builtin): before: $ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done real 4m13,539s user 49m24,416s sys 3m18,177s after: $ time for ((i=0; i < 3; ++i)) do touch src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done real 3m55,697s user 45m19,941s sys 3m7,370s Task-number: QTBUG-97601 Pick-to: 6.3 Change-Id: Ia8e37a58937568a7ed21cfeb4b27274deca4d53b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QStringConverter: fix int/qsizetype mismatches (ex Win32)Marc Mutz2022-01-211-9/+9
| | | | | | | | I can't test on Windows, so skipped the platform-specific code. Pick-to: 6.3 6.2 Change-Id: Id13d4abc447ddd5d17fb67b670b83207877456f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTableWidgetSelectionRange: make relational operators noexceptMarc Mutz2022-01-211-4/+4
| | | | | | | | Also remove the superfluous inline keyword. Pick-to: 6.3 Change-Id: I2cd2fc46687626a6f9eab60553bc3022c7eed6de Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Enable QStyle::State_Horizontal when initializing QStyleOptionProgressBarZhang Hao2022-01-211-1/+1
| | | | | | | | | | | | Since by default QStyleOptionProgressBar is initialized with initialize QStyle::State_Horizontal, the example shouldn't overwrite the state, and instead OR other states into it. Otherwise, the progressbar will be laid out vertically. Pick-to: 6.2 6.3 Fixes: QTBUG-100067 Change-Id: Ibebda48a297af4a621719673033f8199b8bc7984 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Optimize ContinuationWrapper used for support of move-only continuationsSona Kurazyan2022-01-212-4/+12
| | | | | | | | | | | | | | | After QFuture continuations became non-copyable (see earlier commits), we have to always use ContinuationWrapper to save the continuations inside std::function, since it requires the callable to be copyable. Optimize the wrapper, by storing the callable directly (instead of using a ref-counted QSharedPointer) and introducing a fake copy-constructor that makes sure that it's never called. Pick-to: 6.3 6.2 Change-Id: I0ed5f90ad62ede3b5c6d6e56ef58eb6377122920 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Create QFutures returned by QtFuture::when* methods via QPromiseSona Kurazyan2022-01-211-10/+10
| | | | | | | | | | | | | | This is required to ensure that the continuation attached to a QFuture returned by QtFuture::when* methods is cleaned in the destructor of the associated QPromise, so that it doesn't keep any ref-counted copies to the shared data, thus preventing it from being deleted. Task-number: QTBUG-99534 Pick-to: 6.3 Change-Id: If4e2929b2e638d6b48c95f0aef9dc886066cedbe Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use QPromise when creating continuations to avoid memory leaksSona Kurazyan2022-01-212-136/+103
| | | | | | | | | | | | | | | | | Continuations were using QFutureInterface to create and return the associated future to the user. Attaching a continuation to the returned future could cause memory leaks (described in an earlier commit). Use a QPromise when saving the continuation, to make sure that the attached continuation is cleaned in the destructor of the associated QPromise, so that it doesn't keep any ref-counted copies to the shared data, thus preventing it from being deleted. Task-number: QTBUG-99534 Pick-to: 6.3 6.2 Change-Id: I52d5501292095d41d1e060b7dd140c8e5d01335c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix memory leaks when capturing a QFuture in its continuationSona Kurazyan2022-01-214-3/+86
| | | | | | | | | | | | | | | | | | | | | | Capturing a QFuture in the continuations attached to it results in memory leaks. QFuture's ref-counted data can only be deleted when the last copy referencing the data gets deleted. The saved continuation that keeps a copy of the future (as in case of the lambda capture) will prevent the data from being deleted. So we need to manually clean the continuation after it is run. But this doesn't solve the problem if the continuation isn't run. In that case, clean the continuation in the destructor of the associated QPromise. To avoid similar leaks, internally we should always create futures via QPromise, instead of the ref-counted QFutureInterface, so that the continuation is always cleaned in the destructor. Currently QFuture continuations and QtFuture::when* methods use QFutureInterface directly, which will be fixed by the follow-up commits. Fixes: QTBUG-99534 Pick-to: 6.3 6.2 Change-Id: Ic13e7dffd8cb25bd6b87e5416fe4d1a97af74c9b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove obsolete virtual method after submodules adjustedVolker Hilsheimer2022-01-211-4/+1
| | | | | | | | | | Amends cb27ed30f7bc58474eba991f837843eb76cbd339 after follow-up change 43fb6953fb940edfec358a2d1c01e05705712829 in Qt Svg. Task-number: QTBUG-99642 Pick-to: 6.2 6.3 Change-Id: Ice190dc9d1bdcb08d74c86edf0028cf50266d94e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* JSON: Further improve the duplicate handling in the parserUlf Hermann2022-01-216-13/+138
| | | | | | | | Avoid some unnecessary comparisons and add more tests. Task-number: QTBUG-99799 Change-Id: I3aee9f0b62461d38dadbe8e969444e1cd1f94e68 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QFactoryLoader: merge the global statics into a single structThiago Macieira2022-01-211-12/+21
| | | | | | | | Drive-by update one more for to ranged-for and make sure we don't create the global statics on destruction. Change-Id: I5e52dc5b093c43a3b678fffd16b5ff674dfd17ae Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFactoryLoader: replace indexed loops with ranged onesThiago Macieira2022-01-211-16/+12
| | | | | | | | Better code style. I need to optimize QCborValueRef::toString() to avoid a round-trip through QCborValue. Change-Id: I5e52dc5b093c43a3b678fffd16b5f1f99851cf5f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFactoryLoader: use RAII for QLibraryPrivateThiago Macieira2022-01-211-9/+10
| | | | | | | Good style. Change-Id: I5e52dc5b093c43a3b678fffd16b5f15fddb9d8b4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFactoryLoader: use QDirIterator instead of QDirThiago Macieira2022-01-211-4/+4
| | | | | | | | | This showed up on a benchmark when the number of files in the directory was way too big. Change-Id: I5e52dc5b093c43a3b678fffd16b5ef9a938abc63 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Work-around crash in QThreadPool QThread usageAllan Sandfeld Jensen2022-01-212-2/+6
| | | | | | | | | | | This works around mismatch in threads starting and restarting QThreads, and is safe since we don't need to establish a binding, and objectName access in QThreadPool is locked behind a mutex. Pick-to: 6.3 6.2 Fixes: QTBUG-96718 Change-Id: Id3f75e4f8344796ca658899645219fe3373ddd6d Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFactoryLoader: remove check-before-use of a directoryThiago Macieira2022-01-201-3/+0
| | | | | | | | | Unnecessary. We can't read a directory's entries if it doesn't exist or isn't a directory. Change-Id: I5e52dc5b093c43a3b678fffd16b5edce70eb651e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFactoryLoader: there's only one of this, so removeOne(this)Thiago Macieira2022-01-201-1/+1
| | | | | Change-Id: Ice04365c72984d07a64dfffd16b47b4f8223e3fd Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFactoryLoader: add setExtraSearchPath() (for QPA plugins' use)Thiago Macieira2022-01-205-76/+75
| | | | | | | | | | | | | | | | | This is added specifically for the QPA platform and theme plugins, to honor the QT_QPA_PLATFORM_PLUGIN_PATH environment variable and the (inadvisable) -platformpluginpath command-line argument. This removes the last QFactoryLoader used with an empty path (also the only two that could be reached), which were causing a scan of the application's binary directory whenever the platform plugin path was set. In case of applications installed to /usr/bin, the entire /usr/bin was scanned, which can be qualified as "not good". Fixes: QTBUG-97950 Pick-to: 6.3 Change-Id: Ice04365c72984d07a64dfffd16b47fe1d22f26d3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFactoryLoader: separate the updating of each plugin pathThiago Macieira2022-01-201-92/+97
| | | | | | | | I'm going to need to call this with a different path. Pick-to: 6.3 Change-Id: I5e52dc5b093c43a3b678fffd16b5ef59376498ee Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qsimd_p.h: add a hack to allow AVX to work with MinGWThiago Macieira2022-01-202-3/+23
| | | | | | | | | | | | | | | | | | | GCC is unable to emit the SEH metadata about the stack aligning that is required to execute AVX aligned instructions (VMOVDQA, VMOVAPS, etc.), so it just doesn't align the stack. That causes crashes on a 50/50 chance every time the compiler attempts to address a stack-aligned variable. In a debug-mode build, because it always loads & saves everything on the stack, the chance of a crash happening is a near certainty. So we hack around it by going behind the compiler's back and instructing the assembler to emit the unaligned counterparts of the instructions every time the compiler wished to emit the aligned one. There's no performance penalty: if the variable is actually aligned, the unaligned instruction executes in the exact same time. Change-Id: Ib42b3adc93bf4d43bd55fffd16c29cac0da18972 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qsimd.h: move the rest of the __xxx__ definitions that MSVC lacksThiago Macieira2022-01-202-32/+15
| | | | | | | | | | The Intel compiler is now based on Clang, so it always defines the macros like Clang and GCC do, so we don't need to worry about it any more. We only need to define the macros that MSVC lacks. Change-Id: Ib42b3adc93bf4d43bd55fffd16c10f0f6fef43ef Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Document that QStandardPath::findExecutable works with absolute pathsAlbert Astals Cid2022-01-211-0/+3
| | | | | | Change-Id: Ib993fa9a5f2c68febac9820e241c8617bb8ba5bc Pick-to: 6.3 6.2 5.15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix version in which SH_Table_AlwaysDrawLeftTopGridLines was addedVolker Hilsheimer2022-01-211-1/+1
| | | | | | | | | Since it shows up as a new enum value in the 6.3 header review, it's reasonable to assume that it was added for 6.3. Pick-to: 6.3 Change-Id: If766ef56f3354644fbda09088514e55b28a44f32 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QWindowPrivate: de-inline dtor and ctorMarc Mutz2022-01-202-0/+9
| | | | | | | | | | | | | | It's private API, but exported, so de-inline the dtor to pin the vtable in QtGui instead of potentially duplicating it in every library that uses the class. Ditto ctor, but that's just code hygiene: we don't want the code to be duplicated across all users. Pick-to: 6.3 Task-number: QTBUG-45582 Change-Id: I91ea38be20fc67795466a68ca5721837255b33a0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Improve QAbstractButton::animateClick testVolker Hilsheimer2022-01-201-5/+28
| | | | | | | | | | | | | | The test is timing sensitive; if it takes more than 100ms to process events, then the timer that clicks the button might have fired. So only verify that the button is still down if 100ms have not yet passed, and verify that at least 100ms have passed when the click is complete. Also use QSignalSpy to test the signal emissions. Pick-to: 6.2 6.3 Change-Id: I95f99e204a17c6709f8e2913eefe4b487e949123 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Windows XP style: Fix coding style violationsVolker Hilsheimer2022-01-201-375/+329
| | | | | | | | | | | | | | | | | | | | Fix various violations of the coding style or general inconsistencies. No claim for completeness. * indentation and line breaks * consistent scopes for case statements where needed * add curly-brackets for if-statements where needed * removed {} where not needed * const'ify a few obvious local variables * remove random empty lines * use auto when type is obvious from cast Deliberately not touching nested if-statements that could be merged into one. Pick-to: 6.3 Change-Id: Ie22b36568f33e18d5f15c751c7fd76e1490133b9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QtCore: replace qSwap with std::swap/member-swap where possibleMarc Mutz2022-01-2043-60/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qSwap() is a monster that looks for ADL overloads of swap() and also detects the noexcept of the wrapped swap() function, so it should only be used when the argument type is unknown. In the vast majority of cases, the type is known to be efficiently std::swap()able or to have a member-swap. Call either of these. For the common case of pointer types, circumvent the expensive trait checks on std::swap() by providing a hand-rolled qt_ptr_swap() template, the advantage being that it can be unconditionally noexcept, removing all type traits instantiations. Don't document it, otherwise we'd be unable to pick it to 6.2. Effects on Clang -ftime-trace of a PCH'ed libQt6Gui.so build: before: **** Template sets that took longest to instantiate: [...] 27766 ms: qSwap<$> (9073 times, avg 3 ms) [...] 2806 ms: std::swap<$> (1229 times, avg 2 ms) (30572ms) after: **** Template sets that took longest to instantiate: [...] 5047 ms: qSwap<$> (641 times, avg 7 ms) [...] 3371 ms: std::swap<$> (1376 times, avg 2 ms) [qt_ptr_swap<$> does not appear in the top 400, so < 905ms] (< 9323ms) As a drive-by, remove superfluous inline keywords and template ornaments. Task-number: QTBUG-97601 Pick-to: 6.3 6.2 Change-Id: I88f9b4e3cbece268c4a1238b6d50e5712a1bab5a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QVulkanWindow: make it possible to override the enabled featuresLaszlo Agocs2022-01-203-2/+50
| | | | | | | | | | | | | | | We already have a precedent for this: the QueueCreateInfoModifier callback. Following the pattern, add a EnabledFeaturesModifier that can alter the VkPhysicalDeviceFeatures that is passed to vkCreateDevice(). [ChangeLog][QtGui][QVulkanWindow] QVulkanWindow can now invoke a callback to alter the VkPhysicalDeviceFeatures object used to create the Vulkan device. This allows enabling 1.1, 1.2, and extension features. Fixes: QTBUG-99803 Change-Id: I5ede0c6bc3430cbb304d4961eb9e44faad5ce4d7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Enable all supported 1.0 device features in QVulkanWindowLaszlo Agocs2022-01-201-0/+23
| | | | | | | | | | [ChangeLog][QtGui][QVulkanWindow] QVulkanWindow is now enabling all Vulkan 1.0 features reported as supported from the physical device. Pick-to: 6.2 6.3 5.15 Task-number: QTBUG-99803 Change-Id: Ib9cfcd449904c67b07e0e2d4ade5bcaeb4cb0ce6 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Baseline: Move the paintcommands code into the shared directoryVolker Hilsheimer2022-01-205-5/+5
| | | | | | | | | It's used by the lancebench and the lance tool, and it will probably be useful for writing some high-dpi related unit and baseline test cases, so move it to the shared folder. Change-Id: I969bab51c9504be13b4c192b4f29f69cd9102868 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QtConcurrent: use variable templates for compile-time checksSona Kurazyan2022-01-203-17/+10
| | | | | | | | | Noticed during the API review. Pick-to: 6.3 6.2 Task-number: QTBUG-99883 Change-Id: I19571343a0cf0609beae2422ef1f69f7a34eb9ac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add QCheckBox test in tst_baseline_widgetsAxel Spoerl2022-01-201-0/+57
| | | | | | | Task-number: QTBUG-99748 Pick-to: 6.3 Change-Id: I45fe3b102fba4dd6a6f8cd08bab5543f12265aa7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>