summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QString: fix UB in replace()Marc Mutz2020-05-091-1/+2
| | | | | | | | | | | | | | | Comparing with <, >, <= or >= such pointers as are not pointing into the same array is UB. A clever compiler could look at the code, determine that the only valid execution is for it to return true, and just always take the copy. While that would be benign, it's not guaranteed that this would be the outcome (it's UB, after all), and, of course, we don't want to take the performance hit if we don't need it. Pick-to: 5.15 Change-Id: I48cda232ff10a3c9fd4babcd7e7103a3aed126e8 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QString: fix UB in insert()Marc Mutz2020-05-091-1/+2
| | | | | | | | | | | | | | | | | | Comparing with <, >, <= or >= such pointers as are not pointing into the same array is UB. A clever compiler could look at the code, determine that the only valid execution is for it to return true, and just always take the copy. While that would be benign, it's not guaranteed that this would be the outcome (it's UB, after all), and, of course, we don't want to take the performance hit if we don't need it. Fix by using std::less, which guarantees a total ordering for all pointers. Pick-to: 5.15 Change-Id: If07b9363b2ecd573f259e4fa972b629362061ce5 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QGraphicsAnchorLayout: port to QHVContainer [4/4]: sweep Orientation -> ↵Marc Mutz2020-05-094-81/+74
| | | | | | | | | | Qt::Orientation This part of the patch changes all remaining occurrences of the local versions of Orientation to Qt::Orientation. Change-Id: Ic9ec19b8f069f614061f319abd30841e10cdd626 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QGraphicsAnchorLayout: port to QHVContainer [3/4]: Orientation as alias for ↵Marc Mutz2020-05-091-24/+3
| | | | | | | | | | | | | | Qt::Orientation There would still be too many renames, so keep the locally-defined names 'Orientation', 'Horizontal', and 'Vertical' as deprecated forwarders to Qt::Orientation, Qt::Horizontal and Qt::Vertical, resp. Follow-up patches will remove these, then, completely. Change-Id: Ifae926a38086027ad8fe4ad07d1d089c03f9508d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix out-of-bounds access when searching arraysVolker Hilsheimer2020-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Reported by Coverity. All arrays in this code have the size Num... - 1, so accessing the entry at Num... - 1 is out of bounds. Since we don't dereference the value, and only use the address of the entry "one past the last" like an end- iterator, this does not actually access out-of-bounds memory. However, this code does rely on undefined behavior. Use pointer arithmetics instead to get the address of the entry "one past the last", which is well defined behavior and should satisfy Coverity. Change-Id: Ie5fbb2da080d6118169f35056763b5d95cfeda62 Fixes: QTBUG-83817 Coverity-Id: 183557 Pick-to: 5.15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* tst_stringview: remove dead codeMarc Mutz2020-05-081-54/+0
| | | | | | | | | | wchar_t hasn't been QStringView's storage_type for a very long time (at least since 5.10). And in Qt 6, we require char16_t support not only in the compiler, but also in the stdlib, so drop the guards and the alternative code paths. Change-Id: I99f28b575f61c16a2497840708beaa4b54a80f57 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QChar: finish port to char16_tMarc Mutz2020-05-082-20/+20
| | | | | | Change-Id: If38405da34543f836e674474c05f2d98ed610a23 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTextOdfWriter: store all bulletChar()s as char16_t'sMarc Mutz2020-05-081-21/+24
| | | | | | | | | | | | | | ... and return them as QStringView from a file-static function so that the conversion to QString is centralized in just one place (and we can think of skipping the QString conversion once QXmlStreamWriter can write QStringViews and not just QStrings). Because the Style enum is ... weird (negative values), plaster the code with static_asserts so that we get to detect breakage when the enum values change. Change-Id: I4ca89b6c2601c6a1153e202de966356bb4f51651 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFontDatabase: store all writingSystemSample()s as char16_t string literalsMarc Mutz2020-05-081-211/+77
| | | | | | | | | | | ... and return them as QStringView from a file-static function so that the conversion to QString is centralized in just one place (and we can think of returning a QStringView in the public API?). Change-Id: Ie33e2af1b57b8cb34672d245fb9205c68260f440 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFontDatabase: store Vietnamese writingSystemSample() in UTF-16Marc Mutz2020-05-081-9/+1
| | | | | | | | | | | The old code stored it in UTF-8 with an encoded BOM. Using the new QString::op+=(QStringView), we can store the string, without the BOM, in ten instead of 15 bytes. Change-Id: Ia1c51da523fcd6298b39bf2ec162a49c7cfdda63 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSslSocket::setSslSonfiguration - set d.configuration properlyTimur Pocheptsov2020-05-082-1/+23
| | | | | | | | | | | | | | We end up with an absurd situation: QSslConfiguration conf; //we set CA certs so that on demand loading is disabled: conf.setCaCertificates({...}); QSslSocket s; s.setSslConfiguration(conf); Q_ASSERT(conf == s.sslConfiguration); // this assert fails. Pick-to: 5.15 Change-Id: I272bed145434082acc6ead95fe3640d222b21131 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMenuPrivate::hideMenu - avoid deleting 'q' too earlyTimur Pocheptsov2020-05-081-0/+30
| | | | | | | | | | | | | | | | This function among other things enters a nested event loop twice. With enough luck processing events may end with posting deferred delete event for 'q' and then ... executing this event leaving the whole call tree with a dangling pointer. This is not very convenient, and we filter out such events to re-post them a bit later. Pick-to: 5.15 Fixes: QTBUG-82349 Change-Id: Ic620273b529b89f2bd57e25df1f91c2754940670 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QCocoaDrag - avoid using the deprecated API if possibleTimur Pocheptsov2020-05-083-1/+104
| | | | | | | | | | | | | | | | | | | | | The -dragImage stopped to work in 10.14 first with change in behavior documented and the new API (AppKit) proposed/advised. Then after some update the old behavior was restored and D&D for multiple URLs was working again without us having to change anything. In 10.15 it's not working anymore and we have to properly fix it and switch to the API advised. The new API is non-blocking, but QCocoaDrag::drag is expected to be blocking so we have to add a nested event loop to emulate the old behavior. Dragging image is a bit problematic (the exception is thrown because number of images (1) and number of items in NSPasteboard are not equal): creating separate images for different drag items looks really messy. So ... we use the same image again and again with the same frame. Fixes: QTBUG-71939 Change-Id: I02c2a10eab280cf4a55513adaf29c22fff934c01 Pick-to: 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add more QCalendar references to \sa sections of QDate docsEdward Welbourne2020-05-081-19/+27
| | | | | | | | | | The QCalendar API is, in places, more efficient or expressive than the QDate facade that accesses it. Make sure those using QDate have a chance to find it. Pick-to: 5.15 Change-Id: Iffdddfa1f4884e316a1c9887a8a5053eefa73499 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringView: add toNSString() / toCFString()Marc Mutz2020-05-083-7/+42
| | | | | | | | | | | | | | Use it in QString and QCocoaMenuItem. As a drive-by, s,OS X,\macos,g. [ChangeLog][QtCore][QStringView] Added toNSString(), toCFString() on macOS. Change-Id: Ib05818015a4be11a0d72d4487fb82c580d27854e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qstringview: modernize functions in help namespaceMarc Mutz2020-05-081-4/+4
| | | | | | | | | | | | | They don't work with std::span, since std::span has neither const_iterator nor cbegin()/cend(). To fix, perfectly forward the return type with decltype(auto) instead of mentioning T::const_iterator, and rely on the const-qualfication of the help::c{r,}{begin,end}() functions' arguments to select the correct T::{r,}{begin,end}() overload. Change-Id: I4992d4bd521d2dc0f9ea51ae70cde8286ae543a5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_qstringapisymmetry: test split() with char16_t sepsMarc Mutz2020-05-081-1/+5
| | | | | Change-Id: I6744291b88d5334764da78375899313ac771294b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge QStyleOptionTabV4 into QStyleOptionTabGiuseppe D'Angelo2020-05-084-30/+22
| | | | | | | | | We don't need the subclass any more now that we can break ABI. Merge it back into the "main" style option class, like already happened during Qt 4->5. Change-Id: Iba6d3df5f87b0c96f01746260f0a93951dad0e27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix minor errors in ISODate and RFC2822Date formats' documentationEdward Welbourne2020-05-081-10/+13
| | | | | | | | | | | | | | Various format characters are not capitalized in the format string, so should not be capitalized in the doc that describes them - especially, the m for minute should not be made to coincide with the M for month. The H for hours *is* capitalized for ISODate, correctly indicating that it's on a 24-hour clock, so make that explicit; and correct the RFC2822Date doc to use HH rather than hh for its hours, likewise. Reflow to our standard 80-column limit for docs. Pick-to: 5.15 Change-Id: I357252817d59436de5806f45d40030b873ca3926 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QTest::ignoreMessage(): interpret the message in UTF-8Edward Welbourne2020-05-082-3/+11
| | | | | | | | | | | | The message to ignore is given in source code, hence UTF-8; it was being ingested as local 8-bit, which lead to problems when a debug message wasn't 7-bit clean and the system's native encoding wasn't UTF-8. Modified QtTest's selftest to check encoding failure. Pick-to: 5.15 Change-Id: I898744a450115b6d2ee992f1d3b36d8efaeeff7e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Catch overflow in QDateTime::fromSecsSinceEpoch()Edward Welbourne2020-05-082-0/+39
| | | | | | | | | | It's documented to be undefined if the number of seconds is outside the allowed range, but it doesn't hurt for that undefined behavior to happen to be that the result is invalid. Added a simple test. Change-Id: I20c3f680c7948b3904f213452272133be77e4d62 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge some QDateTime methods marked for mergingEdward Welbourne2020-05-082-95/+30
| | | | | | | | | New methods added that can take default arguments to make old methods redundant, now that we can break binary compatibility. Change-Id: Iface9d91d4636965285a3ad0c5347fcd7ce5398c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove all locale-dependence from Q(Date|Time)+Edward Welbourne2020-05-085-304/+48
| | | | | | | | | | | | | | | [ChangeLog][Important Behavior Changes][QDateTime] Removed all locale-dependence from QDate, QTime and QDateTime, including the Qt::DateFormat members that select the formats of the default and system locales and the toString(Qt::DateFormat, QCalendar) overload, which only used its calendar for these formats. All toString() methods now use, and all fromString() methods only recognize, the C locale's names for days and months. Use QLocale's methods if you need to take locale into account. Fixes: QTBUG-80441 Change-Id: I3a8968438741afb00f44262f79659c51e9b06c35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move a test of QLocale's methods out of tst_QDateTimeEdward Welbourne2020-05-082-81/+70
| | | | | | | | | | | | It clearly belonged in tst_QDate::toDateTime(), for which it adds a few more test-case and in which it inspires some further testing. The new testing of case-insensitivity doesn't work if the format contains stray non-format characters, so added a new data column to take care of that. Pick-to: 5.15 Change-Id: I73619be02091c97024a84cb963c7029e9fd0569a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Condition some date-time tests on feature textdateEdward Welbourne2020-05-081-8/+18
| | | | | | | | | | They use the Qt::TextDate format, so do depend on the feature. Rename one in the process; nothing in its test has anything to do with de_DE locale. Pick-to: 5.15 Change-Id: I2adae5c46e6009c13b433993ed2c3c761a500bfb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QByteArrayLiteral: Remove const temporary that may prevent optimizationAlbert Astals Cid2020-05-081-2/+1
| | | | | | | | | clang-tidy 10 was complaining about http://clang.llvm.org/extra/clang-tidy/checks/performance-no-automatic-move.html Pick-To: 5.15 Change-Id: I63ba4111e01bb9d3ee87940253c4a79cc42c0bdf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGraphicsAnchorLayout: port to QHVContainer [2/4]: edgeOrientation()Marc Mutz2020-05-082-10/+10
| | | | | | | | | | | | Port edgeOrientation() and all its callers from Orientation to Qt::Orientation. This function is singled out, since one caller is performing a conversion from Orientation to Qt::Orientation, which, if left unchanged, would cause an off-by-one bug. Change-Id: I37365195ea9552243822803b095a3926a28e7dd0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QString: mark qustrlen() as unsuitable for ASanThiago Macieira2020-05-071-0/+5
| | | | | | | | | We load an aligned 16-byte on the first load, even if 14 of the 16 bytes are before the string contents themselves. Pick-To: 5.15 Change-Id: Ibdc95e9af7bd456a94ecfffd1603f2b8c87655b1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Provide qHash for all C++ fundamental typesGiuseppe D'Angelo2020-05-082-9/+56
| | | | | | | | | | Except for (void and) bool, which we may not want to have to avoid accidental implicit conversions. Drive-by, rearrange qHash overloads to C++ types first, and then Qt ones. Change-Id: I9c4ecef5f28568d35ca52e339583851ce53b3bae Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Fix Windows RC file generation for multi-config buildsJoerg Bornemann2020-05-071-14/+38
| | | | | | | | | | | | | | | | | | | | | | For Ninja Multi-Config we now generate RC files in a path matching the current config name. We have to work around https://gitlab.kitware.com/cmake/cmake/-/issues/20682 to add the generated config-dependent RC files to the target. But due to https://gitlab.kitware.com/cmake/cmake/-/issues/20683 the OriginalFilename entry in the generated resource will be wrong for all configurations but the main one. Cross fingers that this will be fixed upstream. In the meantime: ignore the issue. Drive-by changes: - Fix the function comment. - Surround the RC file name by double quotes in case there are spaces in the path. Fixes: QTBUG-83986 Change-Id: If2fec41fa8050b3feb92c3ce051fde1a5bad0239 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* evdevkeyboard: fix input_event time related compilePeter Seiderer2020-05-071-1/+12
| | | | | | | | | | | | | | | Fixes: evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ‘void QEvdevKeyboardHandler::switchLed(int, bool)’: evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ‘struct input_event’ has no member named ‘time’; did you mean ‘type’? ::gettimeofday(&led_ie.time, 0); ^~~~ type Task-number: QTBUG-84012 Change-Id: I1d127561e0406ae570da656d3e31f9434c7b8798 Pick-to: 5.15 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* evdevtouch: fix input_event time related compilePeter Seiderer2020-05-071-1/+9
| | | | | | | | | | | | | | | | | | | Fixes: evdevtouch/qevdevtouchhandler.cpp: In member function ‘void QEvdevTouchScreenData::processInputEvent(input_event*)’: evdevtouch/qevdevtouchhandler.cpp:579:29: error: ‘struct input_event’ has no member named ‘time’; did you mean ‘type’? m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0; ^~~~ type evdevtouch/qevdevtouchhandler.cpp:579:49: error: ‘struct input_event’ has no member named ‘time’; did you mean ‘type’? m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0; ^~~~ type Task-number: QTBUG-84012 Change-Id: Ib8d726a0baf2bdc85da9341229fffaddc0e373ee Pick-to: 5.15 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: vulkan: Fix calling finish() twice with some copy commands in-betweenLaszlo Agocs2020-05-072-22/+146
| | | | | | | | | | | The native command buffer handle was not updated, so the subsequent finish() call attempted to record an invalid VkCommandBuffer. The problem was not present with offscreen frames, only when finish() is called with a swapchain-based frame active. Task-number: QTBUG-84066 Change-Id: I9c4cb701c3dbbc28f237d6ae1cbf65aafd1fa95f Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QGraphicsAnchorLayout: port to QHVContainer [1/4]: local QHVContainerMarc Mutz2020-05-073-41/+47
| | | | | | | | | | | | | | | | | | This part of the patch changes the definitons of the member variables from 'C arrays of extent 2' to QHVContainer and fixes the code where ints were used to index into the array. To not drown in renames, keep the locally-defined enum 'Orientation', and create a local version of QHVContainer whose index operator is overloaded for both Qt::Orientation and the local 'Orientation'. Follow-up patches will remove these, then, completely. After this patch, NOrientations is no longer used, and consequently removed. Change-Id: I2a241520fce4beeb87fc0e26cd6ab18f324a956a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Revert "Don't reference build directory in helper lib pri"Liang Qi2020-05-071-9/+9
| | | | | | | | | | This reverts commit c9d9ac5bb07a737c862b40302cd681f7b3b321fd. This breaks prefix build which tries to link to install folder. Task-number: QTBUG-83967 Change-Id: I084152afde91c2063154bef8ac99d7e997c9394b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* pro2cmake: Add library mappings for the restructured ActiveQt moduleJoerg Bornemann2020-05-071-0/+3
| | | | | Change-Id: I643cb2afc0e4b74abcbd67bb9002ab334337be37 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Remove deprecated API from XML processing overviewKai Koehne2020-05-071-243/+17
| | | | | | | | Pick-to: 5.15 Fixes: QTBUG-83873 Change-Id: I7fce8de11a9fb09a158f7ad5e32c0fcc323dbdf1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Enable warnings-are-errors also for snippetsKai Koehne2020-05-074-0/+6
| | | | | | Pick-to: 5.15 Change-Id: I6b3645924e4f090c7887ce0d6296a71dc8f8159d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove QScreen::orientationUpdateMaskShawn Rutledge2020-05-0713-133/+24
| | | | | | | | | | | | | | | | | | It simplifies the API and reduces surprise to have rotation working by default. On Android, the manifest specifies which orientations the application has been designed to support; on iOS, it is controlled via the UISupportedInterfaceOrientations property list key. In addition, QWindow::contentOrientation() is another way to give a hint to the window manager, or on iOS to directly control whether the window's rotation is locked or not. Task-number: QTBUG-35427 Task-number: QTBUG-38576 Task-number: QTBUG-44569 Task-number: QTBUG-51012 Task-number: QTBUG-83055 Change-Id: Ieed818497f686399db23813269af322bfdd237af Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* pro2cmake: Honor INSTALL_EXAMPLESDIR if definedChristophe Giboudeaux2020-05-071-2/+5
| | | | | | | | | | | | When building examples standalone, 'INSTALL_EXAMPLESDIR' may be undefined. The converted .pro files now check whether the variable is set to prevent installation into unexpected locations. Fixes: QTBUG-81797 Change-Id: I9f97568923c8103011a41d9af7cfe02dd1e40b56 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make build system of installed Qt more relocatableAlexandru Croitor2020-05-0712-106/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way. The following story inspired this change. If a user wants to build a Qt repo into a different install prefix than the usual Qt one, this will fail configuration because we look for various things like syncqt, qdoc, etc relative to CMAKE_INSTALL_PREFIX, which will now point to a different location where none of the above tools are located. The intent for such a use case is to support building Qt packages with Conan, which sets a random install prefix when configuring a repo. The idea is to derive the qt prefix dynamically from the QtBuildInternals package location. Essentially it's a reverse relative path from the QtBuildInternalsConfig.cmake file to the install prefix that was specified when initially configuring qtbase. Once the dynamic prefix is computed (so we know where the possibly relocated Qt is), we can find tools like syncqt and qdoc. This is an initial attempt to support a use case like that. More design work will probably needed in case if tools / libs need to be found in a location different than the Qt install prefix (so support for multiple install prefixes / search paths). An example of such a case would be when building qtdeclarative and qtquickcontrols2 as Conan packages in one go. Most likely the qmltyperegistrar tool will be located in the random install prefix set by Conan, so building qtquickcontrols2 might fail due to not finding the tool in the original Qt install prefix. As to the implementation details, the change does the following: - Dynamically computes and sets the QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when find_package()'ing QtBuildInternals. It's an absolute path pointing to where the relocated Qt is. - When building qtbase this variable is not yet available (due to QtBuildInternalsExtra not existing), in that case we set the variable to the absolute path of CMAKE_INSTALL_PREFIX (but only for the initial qtbase configuration). - Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used for standalone tests purposes. It's not needed now that we compute the location of the Qt prefix dynamically. - The Unixy qt-cmake and qt-cmake-private shell scripts now use a relative path to find the toolchain file we created. - The toolchain file also dynamically computes the location of the Qt packages, and adds them to CMAKE_PREFIX_PATH. - A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding tool locations, mkspecs dir, path environment setup for tools, etc. - Some places still use CMAKE_PREFIX_PATH in the following cases - When determining paths while configuring qtbase (valid cases) - When I wasn't sure what the behavior should be, so I left them as-is (an example is documentation generation, do we want to install it into the random Conan prefix, or into the main prefix? Currently it installs in the random prefix). Note that relocating a Qt installation does not work for non-prefix / non-installed builds, due to hardcoded paths to include directories and libraries in generated FooTargets.cmake files. Task-number: QTBUG-83999 Change-Id: I87d6558729db93121b1715771034b03ce3295923 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Replace hardcoded include dirs for the global qtbase targetsAlexandru Croitor2020-05-071-8/+8
| | | | | | Change-Id: I22a120a0cb8ca690d224b1301b85e704364fbce0 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port qt_string_count() to QStringViewMarc Mutz2020-05-071-8/+7
| | | | | | | | | | | It was not using QStringView API, but immediately dropped to bare metal operations (reinterpret_cast, ushort), subjecting itself to ushort -> char16_t issues. The new formulation avoids low-level primitives. Change-Id: I8e75c7ea7409b133ff43bf5c829aa1f8f7503f11 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QStyleSheetStyle: fix some premature pessimizationsMarc Mutz2020-05-071-5/+6
| | | | | | | | | - Use QStringView to substring before converting to L1 - cache result of toLatin1() Pick-to: 5.15 Change-Id: I509f551913e77075e60903ebe65b880bd3f7e973 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStyleSheetStyle: port a local QSet to QDuplicateTrackerMarc Mutz2020-05-071-4/+5
| | | | | | | | | Apart from a more fitting, minimal, API, QDuplicateTracker also transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or at least reduce, memory allocations. Change-Id: Ice3ebf1891141d2ac1ec9dd069fb40e98d4056c6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QString: remove weird uses of QChar::unicode()Marc Mutz2020-05-071-2/+2
| | | | | | | | Both *rc and fillChar have type QChar. So don't use QChar::unicode() to assign them to each other, just use QChar::op=... Change-Id: I050035ca16d613f3c57eb5a582978d23c2f04f36 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QGraphicsAnchorLayout: rename AnchorData::{orientation -> isVertical}Marc Mutz2020-05-072-11/+12
| | | | | | | | | That's basically what it is, and we don't want to extent the storage from one to two bits when porting QGraphicsAnchorLayoutPrivate::Orientation to Qt::Orientation later on. Change-Id: I965164141e8d08dbf190e2cd71d9bb7a272b1fda Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QLocale/Mac: make envVarLocale() thread-safeMarc Mutz2020-05-071-1/+1
| | | | | | | | | | | | | The old code used a static QByteArray, but would write to it on every invocation of the function. This makes the function non-re-entrant, even though it's callable from non-GUI-threads (via QSystemLocale::fallbackUiLocale()). Fix by using an automatic QByteArray instead. Change-Id: I93eea1dff1c72f3ea280283bb68b4ed47d2a8e1d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add more tests for QtConcurrent::filterReduced()Jarek Kobus2020-05-072-0/+115
| | | | | | | | | | Test the case where reduce function of the form: V function(T &result, const U &intermediate) has T and U types different. Task-number: QTBUG-83802 Change-Id: Ic89396caba16e7e47ae3ec1527e31b8620f1b08c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Cleanup the qtconcurrentfilter testJarek Kobus2020-05-071-1402/+357
| | | | | | | | | | | | | | | | | Get rid of code repetition in concurrentfilter test. Move tests with initial value next to their original version. Join new lambda tests into a common functions testing all possible 16 combinations of functor / function / member / lambda, as they test in fact the same function. There is no need to distinguish lambda case over other cases. This helps in test readability and maintenance. Add missing tests for lambdas with a combination of initial value. Task-number: QTBUG-83802 Change-Id: I45930c1e18a9e4e561909f46a5cbbdf0ad7ba333 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>