summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* QStyle: Add SP_TabCloseButtonVolker Hilsheimer2021-07-203-25/+20
| | | | | | | | | | | | | | Move the static tabBarCloseButtonIcon helper into the standardIcon() implementation, simplified by using QIcon::addFile and the iconResourcePrefix helper. Add corresponding support in standardPixmap(). Use standardIcon() in PE_IndicatorTabClose where tabBarCloseButtonIcon() was previously used to get the icon, leave the caching in place. Fixes: QTBUG-95264 Change-Id: I89c161734553db762caa29f8ab738e3c6e64ea0a Reviewed-by: David Faure <david.faure@kdab.com>
* Fix quadratic performance hit in Q(Multi)Map::insert() with hintEdward Welbourne2021-07-201-9/+19
| | | | | | | | | | | | | | | | | | | | | | | The insert() overloads that took a const_iterator started by calling std::distance(begin(), pos) - which has a cost linear in how far pos is from begin() - in order to, after detach()ing, obtain an iterator at the same offset from the new begin(), using std::next() - also linear. This leads to quadratic behavior when large numbers of entries are added with constEnd() as the hint, which happened to be tested by tst_bench_qmap. That wasn't running, due to some assertion failures, but once those were fixed the hinted tests timed out after five minutes, where their unhinted peers completed comfortably within a second. Check whether detach() is even needed and bypass the std::distance() / std::next() linear delay when it isn't. This brings the hinted tests down to running faster than their unhinted equivalents. Pick-to: 6.1 6.2 Task-number: QTBUG-91713 Change-Id: I6b705bf8fc34e67aed2ac4b3312a836e105ca2f2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Support pt units for sizes, as documentedVolker Hilsheimer2021-07-202-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Declaration::lengthValue only supported 'px' sizes, but one can transform any 'pt' value into 'px' by multiplying with 1.33. Notes: this ignores display DPI, and instead follows the W3C definition of 'pt' and 'px' as absolute lengths [1]. [1] https://www.w3.org/TR/css3-values/#absolute-lengths 1pt = 1/72th of 1 inch 1px = 1/96th of 1 inch so the conversion is px = pt * (72/96). Add unit test that verifies this using QPushButton's icon-sizes property, also with changed font in preparation of adding support for 'em' and 'ex' units in a follow up commit. Task-number: QTBUG-8096 Pick-to: 6.2 Done-with: Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> Change-Id: I58782e7ad0e2ff9d89ed695f8a23b1e584cfed64 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QList: extend testsIvan Solovev2021-07-201-13/+428
| | | | | | | | | | | | | | This patch mostly introduces some test improvements to check the calls of different methods on an empty default-constructed container. Apart from that some other tests are added to extend test coverage. Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: If2bc96158462292bbdf8504942141af94568c729 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Always update the input method when QLineEdit receives focusTang Haixiang2021-07-201-0/+3
| | | | | | | | | | | | | | | The line edit receiving focus might require different input method capabilities (e.g. be a password edit), so the input method needs to be refreshed when focus is received. This implicitly happens on tab focus when the text is selected or the cursor is moved within an input mask, but neither of those might happen, and for click-focus it never happened. Fixes: QTBUG-86846 Pick-to: 5.15 6.1 6.2 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I47c5275d3a9d4d190ebce64269a345431346c17c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qlocale: Add tests for parsing Chakma date and time stringsIevgenii Meshcheriakov2021-07-191-0/+16
| | | | | | | | | | | | Add tests to verify parser behavior with locales that use code points outside of Unicode BMP to represent dates. ccp is used for this because Chakma language uses code points outside of BMP for both letters and digits. QDateTimeParser currently is not able to handle this locale correctly, so the tests are marked as expected failures. Task-number: QTBUG-87111 Change-Id: I1cc6fe7304b47f19950ae0ad3179c4ffa946adb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale_database: Use NamedTemporaryFile for temporary filesIevgenii Meshcheriakov2021-07-191-14/+7
| | | | | | | | | | | Using NamedTemporaryFile instead mkstemp + fdopen simplifies the code. It also makes it easier to switch to using context managers for handling source file modification. Task-number: QTBUG-83488 Pick-to: 6.2 Change-Id: Ibeae840ac6dde3d0b49cd7f985cfa6cd775b7f47 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale_database: Use pathlib to manipulate paths in Python codeIevgenii Meshcheriakov2021-07-195-65/+76
| | | | | | | | | | | pathlib's API is more modern and easier to use than os.path. It also allows to distinguish between paths and other strings in type annotations. Task-number: QTBUG-83488 Pick-to: 6.2 Change-Id: Ie6d9b4e35596f7f6befa4c9635f4a65ea3b20025 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Allow to set TCP network listen(2) backlogDaniel Nicoletti2021-07-1912-17/+48
| | | | | | | | | | | | | | | | | | | | Qt has a hardcoded backlog value of 50, this allows for applications to tune this value. Modern kernels have the SYN cookie feature that reduces pressure from an flood attack, the backlog setting however is then a queue for most likely real completed (SYN/ACK) connections hence, it's easy to get clients connections dropped with this very small limit. [ChangeLog][QtNetwork][QTcpServer] Added QTcpServer::setListenBacklog() to be able to have control over the listen backlog feature. Change-Id: I1c78af6d99e012591e214b7e09fa85c485880d48 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* testlib: Disable automatic backtrace when test crashes on macOS on ARMTor Arne Vestbø2021-07-191-3/+6
| | | | | | | | | Take two. f20edffcc8089fe573e03bd5e092dafc9b0ce568 only disabled the backtrace preamble. Pick-to: 6.2 Change-Id: I972d007af59d13ec6eb11da44fc2b5e25c36e46e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Rename QVector benchmark and its main.cpp for consistencyEdward Welbourne2021-07-192-4/+4
| | | | | | | | | The usual pattern (at least in corelib) is tst_bench_[lowercased class-name] for the test and the same with .cpp for the source-file name. So s/(main|tst_bench_vector)/tst_bench_qvector/g Change-Id: Ic9bd3ac87adfaec189409c2259cc674ebcec602c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up old QVector benchmarkEdward Welbourne2021-07-193-225/+68
| | | | | | | | | | | | Purge comments showing assember from an antique g++ version, skip #if-ery that's always been on, so makes no difference, rename two single-letter variables shared between files, move some extern declarations to a header, wrap parts of a source file in QT_{BEGIN,END}_NAMESPACE, add a TODO against an antique commented out #if-ery kludge. Change-Id: Ic4781960e0c9838027c21d3d392a50f29598132c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Suppress a broken benchmark comparing QVector to std::vectorEdward Welbourne2021-07-192-6/+15
| | | | | | | | | | | | | | | | The test constructs an ersatz object with which to overwrite a QVector's internals, but based it on Qt 5's memory layout. Since Qt 6 completely rearranged that memory layout, the test now crashes (or, in a debug build, trips over an out-of-bounds assertion). So suppress the test until those who perpetrated it and/or the reworking of QVector's internals can work out how to fix it. That way, QA can at least run the benchmark without crashing. Task-number: QTBUG-95061 Pick-to: 6.2 Change-Id: I0e8c8d58f2002497f6e29d0ad25f840e207704a4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Simplify the application permission APIAssam Boudjelthia2021-07-193-66/+66
| | | | | | | | | | | | Remove read/write variants of the permission types to make the API simpler and more versatile. If the user wishes to have more control over the permission requests/checks, they can use more platform-specific code. Pick-to: 6.2 Task-number: QTBUG-94407 Change-Id: I2b72041aa3effaac7e7f7361237cf1146817b525 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QCalendarBackend's ID an opaque typeEdward Welbourne2021-07-198-60/+107
| | | | | | | | | | As Giuseppe pointed out in API change review, an opaque type should be used. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I862a6f52d284317e1243fd91f45bb0af130d154a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Rename QFile benchmark's source file to tst_bench_qfile.cppEdward Welbourne2021-07-192-2/+2
| | | | | | | Let's have fewer files with the same main.cpp name. Change-Id: Iad94478affcca73a25ed29ba4380f1b3ca4f329d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Drop pointless parentheses from round case labelsEdward Welbourne2021-07-191-20/+20
| | | | | Change-Id: I5339523f83aea4d91aaec9bd2570b225287ae23a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace Q_FOREACH() with ranged-for loopsEdward Welbourne2021-07-191-20/+16
| | | | | | | | | In the process, fix two coding-style violations: while loops whose empty bodies were given as a semicolon rather than as empty braces. Also ditch some spurious braces. Change-Id: I2734077f4f54985c4e8d81f846c1fa6fac4f529d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFile benchmark: only set up and tear down the data directory onceEdward Welbourne2021-07-191-99/+73
| | | | | | | | | | | | | | | | | | | | | | | | None of the tests modify the data, so there's no risk that one test will cause another to fail via that. We can thus avoid the repeated cost of that set-up and teardown, which was done repeatedly for each test function since benchmarks get run repeatedly if they're quick. Use QTemporaryDir to manage the test data, so that it's tidied away automagically, instead of trying to tidy up at the end of each test (which was, of course, skipped if the test failed). As drive-bys, fix a typo in a QFAIL()'s message, change some C casts that silently bulldozed const away to reinterpret_cast<>s with the const qualifier and turn some heap buffers into stack buffers to save the need to delete [] them at the end of their tests (also skipped on failure). Inspired by a kindred change by Andreas Buhr and a suggestion on its review by Friedemann Kleint. Pick-to: 6.2 6.1 5.15 Change-Id: I6067eb35babfbac02990ef39817b0d5122f563cd Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Don't create ${target}_qml_files target any moreCraig Scott2021-07-191-8/+3
| | | | | | | | | | | | | | The qml files should now always be added via dedicated functions provided by the qtdeclarative repo. Those functions take care of adding the files to targets so that they will show up in IDE file lists, so we should not add them to a separate target as well. This will also remove one unnecessary build target, which will reduce visual noise in some IDEs. Pick-to: 6.2 Change-Id: I79bf1ea8fb8a2f15643e052d50ac582a91bdff1a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Hold QSslContext in shared_ptrMarc Mutz2021-07-1811-26/+26
| | | | | | | | | | | ... instead of QSharedPointer. QSharedPointer performs twice as many atomic operations per pointer copy as std::shared_ptr, and this is private API, we're not bound by BC constraints, so we can port to the more efficient version. Change-Id: I2e2a02493565a7ca51c86ec0ed66b6ce7c763e41 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QComboBox: fix -Wsuggest-overrideMarc Mutz2021-07-181-1/+1
| | | | | Change-Id: I6fce7f84cf1578ac0e4ee0b2d7da579b54d78ec3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use member function instead of template function to resolve native interfaceTor Arne Vestbø2021-07-1710-66/+53
| | | | | | | | | | | | | | The use of a freestanding function is not needed now that the name doesn't alias the nativeInterface accessor function, and was just adding complexity to the machinery. People not familiar with the code will have an easier time following the flow through the helper member function, and we no longer need to declare our own export macros. Pick-to: 6.2 Change-Id: I17530b7e89939cfc19ab8ffaa076b7129ae02dcf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QGraphicsScene: fix compiler warning about misleading indentationMarc Mutz2021-07-171-4/+4
| | | | | Change-Id: I532b5eeb0d4f9632f517deef61a7528bcb4151c6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SSL: port QSharedPointer<QSslContext> uses to std-compatible API subsetMarc Mutz2021-07-163-14/+13
| | | | | | | | | | | In preparation of porting to shared_ptr. Add a few strategic moves and remove a rather pointless comment stating the obvious. Change-Id: Ie1c0f3431af79bdb204e00d99323bf9f2d100d0d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix generated pri and prl filesLi Xinwei2021-07-175-6/+17
| | | | | | | | | | | | | | | Quote the paths after "-L". Get MSVC’s implicit link directories from $ENV{LIB}. Fix some issues cause by Inconsistent case. Amends 2c49f85380d7ad79d9473e0f42e7afaa36d31af9 Fixes: QTBUG-95198 Pick-to: 6.2 6.1 Change-Id: Ie82f10b088e2764396377726340509f24a4ae8e7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* locale_database: Use argparse module to parse command line argumentsIevgenii Meshcheriakov2021-07-163-72/+71
| | | | | | | | | | | arparse is the standard way to parse command line arguments in Python. It provides help and usage information for free and is easier to extend than a custom argument parser. Task-number: QTBUG-83488 Pick-to: 6.2 Change-Id: I1e4c9cd914449e083d01932bc871ef10d26f0bc2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale_database: Use f-strings in Python codeIevgenii Meshcheriakov2021-07-166-140/+131
| | | | | | | | | | | Replace most uses of str.format() and string arithmetic by f-strings. This results in more compact code and the code is easier to read when using an appropriate editor. Task-number: QTBUG-83488 Pick-to: 6.2 Change-Id: I3409f745b5d0324985cbd5690f5eda8d09b869ca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* locale_database: Add schema for intermediate locale data filesIevgenii Meshcheriakov2021-07-162-0/+151
| | | | | | | | | The schema is in RelaxNG Compact syntax. It can be used to validate files produced by the cldr2qlocalexml.py script and also gives an overview of the file format. Change-Id: I344978f2201c5e67e236ab580a12ad33262f33cb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Handle single- and multi-config differences more robustlyCraig Scott2021-07-171-6/+7
| | | | | | | | | | | | | Projects sometimes set both CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE regardless of what CMake generator they are using. They shouldn't, but it is common enough that we should protect against it. The GENERATOR_IS_MULTI_CONFIG global property is the only robust way to know which type of generator we are using, so switch to that for how we detect this. Pick-to: 6.2 Change-Id: If5d6568da0d2adb3275bbaf9a7d3bd3e033dc636 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Clean up and simplify qt6_extract_metatypes implementationAlexandru Croitor2021-07-163-75/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove copying of json files in non-prefix builds. Previously, this was done to mimic the directory layout of prefix builds in a non-prefix build, but the extra complexity is not worth it. Keeping the files in the build directories of each repo in a non-prefix build should be good enough. As a result, we don't need to distinguish which file path should be passed in INTERFACE_SOURCES. Now we have only 2 paths to consider, the BUILD_INTERFACE one and the INSTALL_PREFIX one, rather than 3 different paths. Move the code that handles installation closer together. Rename the internal COPY_OVER_INSTALL option to ___QT_INTERNAL_NO_INSTALL. We might want to expose it as a public option later, but it depends on whether we will disable default installation for user projects. Remove assignment of some properties that are not used anymore. Amends c431e2d33c2b13dee8b43a08c267c20ec1ae9654 Pick-to: 6.2 Task-number: QTBUG-94942 Change-Id: I3a26d1988987b2ce7c7d01d2311c13b3da3175a8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix qt6_extract_metatypes json file generation ruleAlexandru Croitor2021-07-161-39/+23
| | | | | | | | | | | | | | | | | | | | | | | | Change the copying of ${CMAKE_CURRENT_BINARY_DIR}/${target}_metatypes.json to ${prefix}/lib/metatypes/${target}_metatypes.json to happen as part of the command generating the file, rather than copying the file as part of a separate custom target or POST_BUILD event. This ensures that the custom commands in qt6_qml_type_registration that use those files as dependencies will cause them to be generated before the qml type registration happens, thus eliminating errors like Error 5 while parsing qtbase/lib/metatypes/qt6quick_metatypes.json: illegal value Pick-to: 6.1 6.2 Fixes: QTBUG-94942 Change-Id: Idddd73786d1a622984965c60ac9b4c3bc2c13ab5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QListView: don't scroll if selected items are removedVolker Hilsheimer2021-07-162-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | For SingleSelection, removing the selected item will select the nearest item and, if autoScroll is enabled, ensures that the newly selected item is visible in the viewport. This may result in scrolling. For Multi- or ExtendedSelection, this should not happen, as having no selection is perfectly fine in those modes. However, QListView still tried to scroll to the current item in response to the currentIndexChanged signal. Since the currentIndex is at this point already hidden, the rectangle for it became invalid, and the attempt to scroll resulted in a one-pixel up-movement of the viewport (since the invalid rectangle has width == height == -1). Fix this by not scrolling if the rect for the index is invalid. Note that the index is still valid at this point, so we can't shortcut the call stack earlier. Add test that exercises the different combinations of ViewMode and SelectionMode, and demonstrates the one-pixel movement without the fix. Fixes: QTBUG-94788 Pick-to: 6.2 6.1 5.15 Change-Id: I1f36973eadb46e8c9b8b8068bc76ee09e9f490dd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Tidy up systemCaCertificates() function in OpenSSL backendEdward Welbourne2021-07-161-18/+11
| | | | | | | | | | | | | | | | | | As pointed out by Marc Mutz in another review, the Android branches of its #if-ery amounted to a complicated no-op, so simplify the #if-ery, add a TODO and then simplify the code thereby freed of the need to accommodate the #if-ery. In the process, initialize a set of filenames with the two filenames that we read certificates from after looping over the set, which might have left those files being read twice. Change-Id: I2ee4ee3c3cf40226ee6a50afd6127fa4a71d2834 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Skip trailing space on ends of QFile benchmark namesEdward Welbourne2021-07-161-3/+6
| | | | | | | | | | They were there to make it easier to build the names. Avoiding them wasn't exactly hard. Change-Id: I9e353644d81f80d69ecf73fe4fa875948ccbc2c9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* QFile benchmark: purge fatuous function, inline several moreEdward Welbourne2021-07-161-39/+8
| | | | | | | | | The empty cleanupTestCase() was just clutter. Various tests that shared a common implementation (using different data) might just as well be inline in the class body. Change-Id: I5046d7e6ad5a6425df9f9e0a0a705e229d9d0717 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Export QHttpNetworkReply private to permit it to be used by websocketsØystein Heskestad2021-07-161-2/+2
| | | | | | | Task-number: QTBUG-80700 Change-Id: Ifec9c89a2cde5cae1ab98d95b43de21e5b4531fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QClipboard: remove a useless default switch-case labelWenTao Song2021-07-161-2/+1
| | | | | | | | | | The switch condition expression has already dealt width all the conditions, so a `default` label is not necessary (it introduces a warning). Delete it. Fixes: QTBUG-95223 Change-Id: Iac3d9bb5d0b6fd8372d4dc16d920ce0a7b0511db Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QPainter: replace manual memory management [5/5]: d_ptrsMarc Mutz2021-07-162-20/+10
| | | | | | | | Replace a manually-managed pointer + size with QVarLengthArray, allowing use of pre-allocated space. Change-Id: Ife3abea0b3b0f2577bb76c348513d52d46f79641 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMultiMap: extend unit testsIvan Solovev2021-07-161-143/+581
| | | | | | | | | | | | | Extend tests to explicitly check the behavior of empty default-constructed container. Also add some missing tests to increase the code coverage. Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: Ib3c3f5bcb967cd1031cb24ffceaa77a146212ffd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* CMake: Apply bitcode flags to internal plugin object lib initializersAlexandru Croitor2021-07-163-4/+12
| | | | | | | | | | | | | | | | | | | | | | All internal libraries, plugins, object libraries (resources, plugin initializers) need to be built with bitcode flags when targeting iOS. Internal here means all libraries added by qt_internal_add_X functions or associated with internal libraries. We didn't do that for plugin initializers, which were added not too long ago. Extract the logic that links to Qt::PlatformModuleInternal into a separate function to be used for object libraries. Use it for resources and plugin initializers. It will also be used in qtdeclarative for qml plugin initializers. Pick-to: 6.2 Task-number: QTBUG-95208 Change-Id: I366996078f5e9d1c2d2797f6b81c522ee99529e3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't propagate -fapplication-extension to user projectsAlexandru Croitor2021-07-165-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | Both the compiler and linker -fapplication-extension flag should only be applied when building Qt's libraries (not executables). It's up to the user project whether their code will be restricted with application-extension-only APIs. In qmake that can be achieved by adding to the qmake project CONFIG += app_extension_api_only In CMake it can be achieved by either adding the compiler and link flags in the project directly (using target_X_options) or by setting the appropriate setting in the Xcode project when using the Xcode generator. Amends e189126f1ae1d2fa2ad0f95ee2c4aa72c770a97b Pick-to: 6.2 Task-number: QTBUG-95199 Change-Id: Ie7a764d460a89c7650391abff0fcc5abfcabef64 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix bitcode linker flags not to be added on iOSAlexandru Croitor2021-07-161-1/+0
| | | | | | | | | | | | | | | | | | | We shouldn't force add the bitcode linker flags to user projects. And we don't link anything when building Qt for iOS itself, we only archive object files into static libraries. The final decision whether bitcode should be used is up to the Xcode project. That is controlled by Xcode's ENABLE_BITCODE option. Bitcode compile flags are still added when building Qt itself. Amends a0468331761b497992e9d554c210583781308272 Pick-to: 6.1 6.2 Task-number: QTBUG-95199 Change-Id: I04c77f659b82269bb8010ea262b2e51f36e9def3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add qtpaths6 aliasKai Köhne2021-07-161-0/+1
| | | | | | | | | | | | | | | | Make qtpaths also available under qtpaths6. In fef850c51a069, qtpaths got extended to replicate the 'qmake -query' behavior. This was meant for IDE's like Qt Creator, so that they can use qtpaths instead of qmake to identify Qt versions. Anyhow, since qtpaths was also available in Qt 5, letting users just select _any_ qtpaths executable won't work for this purpose. Adding qtpaths6 - like qmake 6 - allows IDE's to query for a Qt 6 qtpaths. Pick-to: 6.2 Task-number: QTCREATORBUG-25546 Change-Id: Ifc7e1a76b26cf706872db1bb1f9d3de5f006de24 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QPainter: replace manual memory management [4/5]: emulationEngineMarc Mutz2021-07-162-21/+8
| | | | | | | | | | | Use unique_ptr to indicate ownership. The QPainter dtor is now empty, = default it. As a drive-by, fix a non-sensical if (p) p = nullptr; Change-Id: I5c811eb7de6abf8a9f279cf3630d5f86db6b3864 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPainterPrivate: use NSDMI, outline ctorMarc Mutz2021-07-152-16/+17
| | | | | | | As a drive-by, make the ctor explicit. Change-Id: I4c0c597e4b6e96e800017c90acced33bbccd1d10 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add note about precision of QNativeGestureEvent::delta; fix in Qt 7Shawn Rutledge2021-07-152-5/+19
| | | | | | | | | | | We keep QVector2D storage Qt 6 BC (to avoid making QNativeGestureEvent larger), but in Qt 7 we should return exactly the same value as given (for what it's worth, in spite of this being overkill for panning a reasonable distance). Change-Id: Iecbd4c9b60ad9ae5e0466c7027b038ddb85b8c8b Pick-to: 6.2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Consistent handling of disabled items in QItemSelectionModelAndreas Buhr2021-07-156-23/+70
| | | | | | | | | | | | | | | | | | | | | | | | In QItemSelectionModel, items which are disabled or marked as not selectable should not be considered as selected. But this was not handled consistently. The following methods considered only items which are enabled and marked selectable: selectedIndexes(), rowIntersectsSelection(), and columnIntersectsSelection(). The following methods considered only items which are marked selectable, but did not check whether they are enabled: selectedRows(), selectedColumns(), isRowSelected(), isColumnSelected(), isSelected(). Finally there is hasSelection(), which did not check for enabled nor for selectable. This patch introduces consistent behavior. All methods check both whether the items are enabled and whether they are selectable now. [ChangeLog][QtCore][QItemSelectionModel][Important Behavior Changes] All methods in QItemSelectionModel now consider only items which are marked as enabled and selectable as part of the selection. Fixes: QTBUG-93829 Pick-to: 6.2 Change-Id: I4725243ea6b0db4f289ce34ada22c7a9d3282713 Reviewed-by: David Faure <david.faure@kdab.com>
* Initialize class members of QTreeWidgetItem at declarationAndreas Buhr2021-07-152-57/+15
| | | | | | | | | The members view, par, and itemFlags were initialized in each of its nine constructors. This patch moves the initilaization to the declaration to prevent this repetition. Change-Id: I71d136e7615dca5d87e8a4dc161c877633017ad0 Reviewed-by: David Faure <david.faure@kdab.com>
* QCryptographicHash: use a std::array to hold result (was: QByteArray)Marc Mutz2021-07-156-37/+78
| | | | | | | | | | | | | | | | | | | | | | The maximum size for a hash result is 64 atm. Even if, and esp when, we'll get to 128 and 256 bytes in the future, there's no reason to use dynamic memory, because the sizes will always be statically known. So use, essentially, a std::array<char, 64> to hold the result internally. Add a bit of convenience API on top to limit impact on the rest of the code and add a few static_asserts that ensure this is large enough. Then give users access to the internal buffer by adding QByteArrayView resultView() const noexcept. The documentation snippet is taken from QString::data(), suitably adjusted. Use resultView() in a few places instead of result(). [ChangeLog][QtCore][QCryptographicHash] Changed to use a statically-sized buffer internally. Added resultView() to access it. Change-Id: I96c35e55acacbe94529446d720c18325273ffd2f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>