summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Adjust permissions.prf plist path handlingJuha Vuolle2023-02-131-2/+3
| | | | | | | | | | | | | Few tweaks: - Remove extra closing parenthesis - Use absolute paths as the exists() checks & other plist path uses are relative to the permissions.prf location - Use the plist path with PlistBuddy instead of the variable from .pro file Pick-to: 6.5 Change-Id: I27c7f1e7044a55ff7fbd78ef1dd79c92b17e8018 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Update bundled libjpeg-turbo to version 2.1.5Eirik Aavitsland2023-02-1321-87/+154
| | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.5 Pick-to: 6.5 6.4 6.2 5.15 Task-number: QTBUG-110336 Change-Id: Ifc08ad7f1a3c5b3e66b11e5a51d523b091288790 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QVarLengthArray: clear() is not resize(0)Marc Mutz2023-02-131-0/+10
| | | | | | | | | | | | | | The latter needs the value_type to be default-constructible, which shouldn't be required to clear() a container. Use std::destroy_n() instead. [ChangeLog][QtCore][QVarLengthArray] clear() no longer requires the value_type to be default-constructible. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I806de8f3826b50c0bd38156892c3afeb15f13ac9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ODBC/MySQL: fix compilation with MySQL < 5.7.9Christian Ehrlicher2023-02-121-0/+5
| | | | | | | | | | | MYSQL_TYPE_JSON was introduced in MySQL 5.7.9 but our documentation states that we still support 5.6 so we have to define this value by ourself for the older versions. Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-109832 Change-Id: I935edb14495d162ed58109610946b2805d37bbc4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/MySQL: add options to explicitly specify the protocol typeChristian Ehrlicher2023-02-122-1/+32
| | | | | | | | | | | | [ChangeLog][QtSql] Added the ability to specify the MySQL/MariaDB connection type using the "MYSQL_OPT_PROTOCOL" connection string option. In case the connection type is "MEMORY" for shared memory, applications can specify the shared memory segment name using the "MYSQL_SHARED_MEMORY_BASE_NAME" option. Fixes: QTBUG-2551 Change-Id: I91e0981994c045fb74478d0e765e2ec24eefeece Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build with -no-feature-actionTasuku Suzuki2023-02-122-0/+6
| | | | | | | | | /home/tasuku/io/qt/code/qt/qt5/qtlite/qt5/qtbase/src/plugins/platformthemes/gtk3/qgtk3interface.cpp:640:59: error: return type ‘class QIcon’ is incomplete 640 | QIcon QGtk3Interface::fileIcon(const QFileInfo &fileInfo) const Pick-to: 6.5 Change-Id: I2936a3d7ae4cca200f946103b97659819775a8da Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: map Qt::Key_Return to NSCarriageReturnCharacter in menusVolker Hilsheimer2023-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | On macOS, key combinations with the Return key do not get delivered through NSView::keyDown, but they are seen by the QCocoaNSMenu::menuHasKeyEquivalent override. We already use that override to check whether any menu item uses a matching shortcut, and give Qt's focus object a chance to override the shortcut. The key mapper used the NSNewlineCharacter '\n' for Qt::Key_Return. However, the character we get from macOS for the return key is the NSCarriageReturnCharacter character, '\r'. This makes the lookup fail, and shortcut overrides are not delivered for shortcuts using Qt::Key_Return. To fix this, map Qt::Key_Return to NSCarriageReturnCharacter. The inverse mapping maps both NSCarriageReturnCharacter and NSNewlineCharacter to Qt::Key_Return, and there are no other users of this function in Qt. Pick-to: 6.5 6.4 Fixes: QTBUG-107526 Change-Id: I716190adf3cd94697e2b3ad1afc25b95d8ebde25 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAbstractItemView: Don't unselect on click on empty area in SingleSelectSebastian Beckmann2023-02-112-1/+37
| | | | | | | | | | | | | | | | dfb4697e4a4828acd47292a89207b3975ec6766e made a change to selection behavior that resulted in a regression where clicking on an item view but not on an item would cause the current item to get unselected. Changes the behavior to not update in this case. Added a new test that specifially checks for this scenario and ensures that the current item is still selected, even after the user clicks on empty area. Fixes: QTBUG-105870 Pick-to: 6.2 6.4 6.5 Change-Id: I191c3878819b99897083039fba0ab43908da5429 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-libraryTasuku Suzuki2023-02-112-1/+1
| | | | | | | | | qtbase/src/dbus/qdbus_symbols.cpp:18:17: error: ‘Qt’ has not been declared 18 | using namespace Qt::StringLiterals; | ^~ Change-Id: Iaa5f1947bb832706b69e954103761193509644d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtMiscUtils: fix return type of two helpers, should be boolAhmad Samir2023-02-111-2/+2
| | | | | | | | Pointed out by Oswald Buddenhagen. Pick-to: 6.5 Change-Id: I3e38e0aee4555a1f37b8dbade38b6a0b3428f74c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix Qt 6 performance regression when painting outside deviceEirik Aavitsland2023-02-103-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | Painting wide lines and filling would be clipped to cliprect (by default, the device rect) only if the bounding rect coordinates exceeded QT_RASTER_COORD_LIMIT. In Qt 6, that limit was raised from 2^15 to 2^23, so a lot of time could be spent on rasterizing elements that would anyway be outside the rendering area. Fix by instead clipping whenever the path to be painted overshoots the cliprect by a significant margin. At this point, the path is already flattened to straight lines, so clipping is quick and precise. Testing indicates that this solution improves performance a lot when large portions of the elements to be painted fall outside the cliprect, while not causing significant performance hits otherwise. As a side effect, it is then no longer necessary to test the bounding rect explicitly against QT_RASTER_COORD_LIMIT, since we already make sure that the clip rect we check against is within that limit. Fixes: QTBUG-110595 Pick-to: 6.5 6.4 6.2 Change-Id: Iaf1afbb481c2d7059405f334278796ad46f5bcb6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-10105-789/+88
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Avoid mapping BUILD_TESTING to QT_BUILD_TESTSAlexey Edelev2023-02-101-1/+0
| | | | | | | | | | | This leads to unwanted side issues such as building and running third party component tests. The option should be enabled explicitly by user instead. Fixes: QTBUG-111091 Change-Id: I8942db2bd089ad2a39a70627bfce8314b101ecb8 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* tst_qvarlengtharray: fix MyBase trackers for swap()Marc Mutz2023-02-101-0/+34
| | | | | | | | | | | | | | I don't begin to understand the semantics of the trackers here, but whatever they are, they break with the fallback std::swap() 3-moves implementation and lose track of alive objects, so provide an ADL swap that does the right thing. Amends dd58ddd5d97f0663d5fafb7e81bff4fc7db13ba7 (I think). Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I1cd49c95dca2d103a26c2c7ac0a896929135a6c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove "Configuration summary shown below" statement when it is not trueAmir Masoud Abdol2023-02-101-19/+19
| | | | | | | | | Cleanup the generated message regarding the configuration summary. Also moved the flushing into the helper function. Pick-to: 6.5 Change-Id: I45728ac5b43613f002b6d5b07b9ad037416c4fff Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Improve FindWrapRt, and SHM detectionAmir Masoud Abdol2023-02-103-9/+27
| | | | | | | | | | | | | | | | | | | | Apparently, more and more librt functionality are being moved to glibc these days, e.g., clock_gettime, clock_getres, clock_settime, clock_getcpuclockid, clock_nanosleep. As Thiago mentioned, in face, all librt functions are moving into glibc, but unlike the clock_* functions that I can see are ported from 2.17+, I cannot find out when and what functions are already ported. So, here, I added a second test which tries to explicitly look for shm_* functions, if they are there, as well as the clock_* function, then we are more confident that we actually have a useful the libRt in the system. Also, making the FEATURE_posix_SHM depends on UNIX. Pick-to: 6.5 Fixes: QTBUG-111049 Change-Id: I08b7f4656ecd9313b552fb05ca7096f5b987b95a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build without abstractsliderTasuku Suzuki2023-02-111-0/+1
| | | | | | | | | | qtbase/src/widgets/styles/qcommonstyle_p.h:102:53: error: field ‘animations’ has incomplete type ‘QHash<const QObject*, QStyleAnimation*>’ 102 | mutable QHash<const QObject*, QStyleAnimation*> animations; | ^~~~~~~~~~ Pick-to: 6.5 Change-Id: Ib7b4a5031c1447248f4db1f4ea6629a31d610bcb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tracegen: Fix handling enumerators with duplicate valuesAntti Määttä2023-02-105-22/+72
| | | | | | | | | | Aggregate the names of the same value enumerators. The values can also be hexadecimal so handle them also. Pick-to: 6.5 Change-Id: I89693d7e3b8f6c051b298401dcbe8a9f5c0a38aa Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* tracegen: Add support for QSizeF and QRectF typesAntti Määttä2023-02-105-1/+29
| | | | | | | Pick-to: 6.5 Change-Id: Ie19523b84026312c3d5a597914abc2622dba3f68 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* CTF: Fix minor problems in the implementationAntti Määttä2023-02-102-13/+29
| | | | | | | | | | | - Check if trace location is writable - Call fclose only if file is opened - Convert metadata to QByteArray in one place. - Add constraint to array operator. Pick-to: 6.5 Change-Id: Id01998fe8e754dab7a4b7d8ce1361ac822d01390 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* SQL/MySQL: Fix retrieving a datetime for libmysql >= 8.0.27Christian Ehrlicher2023-02-101-9/+19
| | | | | | | | | | | | | | Somewhere between libmysql 8.0.18 and 8.0.27, the MYSQL_TIME structure gained an additional member which increased the struct size by 4 bytes. This makes an internal check for the correct size of the structi go fail. Since it can now happen that the plugin is linked against a new libmysql and used with an old and the other way round, duplicate the old MYSQL_TIME struct to use this in our code Pick-to: 6.4 6.5 Fixes: QTBUG-110967 Change-Id: I5bc631179a0a1be47a5966954e757f27a72f1592 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SQL/ODBC: add handling for SQL_SS_TIME2Christian Ehrlicher2023-02-101-0/+6
| | | | | | | | | | MSSql Server sometimes returns SQL_SS_TIME2 instead SQL_TIME. Since this value is non-standard, we have to define it by ourself. Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-109206 Change-Id: I40a4b32590d877ebfdc4b2f1d9080d8cdb2ae7a5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* double-conversion: Update to 3.2.1Mårten Nordheim2023-02-104-9/+16
| | | | | | | | | | | Retrieved from/changelog here: https://github.com/google/double-conversion/releases/tag/v3.2.1 Pick-to: 6.5 Task-number: QTBUG-110333 Change-Id: I3e1af9adca37d89ce91812d594e9dd222d35ba8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Long live QScopedPropertyUpdateGroupMarc Mutz2023-02-105-34/+80
| | | | | | | | | | | | A RAII wrapper around Qt::{begin,end}PropertyUpdateGroup(). [ChangeLog][QtCore][QScopedPropertyUpdateGroup] New RAII class wrapping Qt::beginPropertyUpdateGroup() and Qt::endPropertyUpdateGroup(). Fixes: QTBUG-110710 Change-Id: If2619e9584dd9d57985d63e3babca75421499ab9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* trace: Remove unused tracepoint filesAntti Määttä2023-02-104-454/+0
| | | | | | | | | | These can be removed now that the modules use tracepointgen tool. Pick-to: 6.5 Change-Id: I265e019f99e1ccc557a284ff53b110073066e530 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Trace: Autogenerate metadata in qtgui moduleAntti Määttä2023-02-101-45/+2
| | | | | | | | Pick-to: 6.5 Change-Id: I300ecb9d25f0ecb7208c643704adf66bdf0a4b56 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* CTF: Move event metadata generation to the wrapperAntti Määttä2023-02-108-119/+180
| | | | | | | | | | | This fixes the metadata generation when cross compiling. The metadata needs to be generated based on the type info of the target. Currently the metadata is generated in the tool based on the host type info. Task-number: QTBUG-110270 Pick-to: 6.5 Change-Id: Ibcdcbd690620afc532d6007cf036229342bdcc31 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CTF: Fix plugin cleanupAntti Määttä2023-02-103-1/+22
| | | | | | | | | | Handle cleanup of the CTF plugin correctly. The cleanup causes recursive trace event so the plugin needs to handle this. Pick-to: 6.5 Change-Id: Id6f4c6efe95e51332a8be97fecdf7886ba173e43 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* Fix build with -no-feature-texteditTasuku Suzuki2023-02-101-1/+2
| | | | | | | | | | qtbase/src/widgets/styles/qstylesheetstyle.cpp: In function ‘quint64 extendedPseudoClass(const QWidget*)’: qtbase/src/widgets/styles/qstylesheetstyle.cpp:2577:1: warning: control reaches end of non-void function [-Wreturn-type] 2577 | } Pick-to: 6.5 Change-Id: Id53d637d43a8d530a7bdfbd7d5b823162d1399b5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-gesturesTasuku Suzuki2023-02-111-0/+2
| | | | | | | | Disable xcb touchpad gesture when gestures is not available Pick-to: 6.5 Change-Id: Idd2fec38646fad4cbda20ab1e560949c8e8844ff Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-toolbuttonTasuku Suzuki2023-02-111-1/+1
| | | | | | Pick-to: 6.5 Change-Id: Id583165602e84ea0fae972c377ced30e4a4d96cb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* fbconvenience: use smart pointer for QFbCursorLiang Qi2023-02-102-2/+2
| | | | | | | Pick-to: 6.5 6.4 6.2 5.15 Fixes: QTBUG-110785 Change-Id: Id82fc300c5716ce68a2609b7fb36195f2d37e322 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't do font merging for PUA charactersEskil Abrahamsen Blomfeldt2023-02-102-1/+41
| | | | | | | | | | | | | | | | | | | | | The "Private Use Area" are subsets of Unicode which are not considered regular characters, but reserved for fonts to provide custom glyphs. If these were used and the main font did not have support for them, we would look them up in other fonts and sometimes display an arbitrary selection of glyphs, based on whatever existed on the platform. This is unexpected and different from how native apps work on Windows, for instance. [ChangeLog][QtGui][Text] Font merging (automatic assignment of alternative fonts) is no longer applied for characters in the Private Use Areas of Unicode. Pick-to: 6.5 Fixes: QTBUG-110502 Change-Id: Id2c63786aafda59bf170e0d7263eb78a391fe46d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Return transparent background color if no brush is setMatthias Rauter2023-02-101-1/+2
| | | | | | | Fixes: QTBUG-110751 Pick-to: 6.5 Change-Id: I6fa33ba22b0209da6c9e1022851f84c892a5ae5f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Trace: Use includes instead of forward declarationsAntti Määttä2023-02-103-6/+5
| | | | | | | | | | Some platforms do not work with forward declarations, mainly android. Pick-to: 6.5 Change-Id: Ie34a30ecb8554d77c1bea4b65a752d63ba819af9 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Trace: Convert qtwidgets module to use tracepointgen toolAntti Määttä2023-02-102-1/+9
| | | | | | | | Pick-to: 6.5 Change-Id: Iaa993387ecbaeab66c1bd226a85c9ab6d876b157 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Trace: Convert qtopengl module to use tracepointgen toolAntti Määttä2023-02-104-18/+27
| | | | | | | | Pick-to: 6.5 Change-Id: I441455a4d49a559fb591ea5c8cffb97af66fb2b1 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Trace: Convert qtcore module to use tracepointgen toolAntti Määttä2023-02-107-2/+48
| | | | | | | | Pick-to: 6.5 Change-Id: I379896280a16cd0b94d7ee9d0cfcca4afe64b9fe Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Tracepointgen: Parse metadata from include filesAntti Määttä2023-02-104-8/+335
| | | | | | | | | | | | | | The tracepointgen tool needs to know the enumeration/flag names and values in order to generate metadata for the tracepoints in order to pass this information when tracing. Currently the metadata needs to be provided to the tracepointgen by hand. This implements metadata parsing from header files. Task-number: QTBUG-110598 Pick-to: 6.5 Change-Id: Ibb2cc6e724fd2defca4e301af2285b0fdbe8e7f7 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* IPC/QSharedMemory: add missing includeSamuli Piippo2023-02-101-0/+1
| | | | | | | | | | | | Include header defining MAP_FAILED for SysV sharedmemory to fix: src/corelib/ipc/qsharedmemory_systemv.cpp:175:25: error: ‘MAP_FAILED’ was not declared in this scope; did you mean ‘AF_FILE’? 175 | if (self->memory == MAP_FAILED) { | ^~~~~~~~~~ Change-Id: Ia30539d90faad911909f2556b655758ddea6efdb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDir: use QCollator when doing locale-aware sortingAhmad Samir2023-02-102-19/+55
| | | | | | | | And don't use toLower() as QString::compare() and QCollator::compare() can compare case-insensitively. Change-Id: I999d787cb77e10a101da75d1bf0a5baf096a5c9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: don't detach in replace_helper()Ahmad Samir2023-02-092-51/+114
| | | | | | | | | | | | | | | | | | | | I.e. don't detach in the replace() overloads that delegate to replace_helper() if this string is shared, instead create a new string and copy characters from this string to it, along with the "after" string, then swap it with this. Do the same thing if "before" is shorter than "after" and there isn't enough capacity to do the replacement without reallocating. Use std::copy* and std::move*, which will both fallback to memmove/memcpy, but they have C++ API, which is more readable. [ChangeLog][QtCore][QString] Using replace() on a currently shared QString is now done more efficiently Task-number: QTBUG-106184 Change-Id: If74ffa1ed47636dc23d543d6dc123d8f2b21d537 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: Add exclusions for Unity buildsFriedemann Kleint2023-02-091-0/+24
| | | | | | | Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I055fbc29e85cbb58af9c5a423f6f7be4fbb0c40a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPasswordDigestor: add OpenSSL 3.0 support to deriveKeyPbkdf2Jan Grulich2023-02-092-2/+101
| | | | | | | | | | | Use OpenSSL 3.0 in deriveKeyPbkdf2() if it's available. This currently produces same results, but in the future we will have possibilities to force some additional compliancy, for example we can enable SP800-132 compliance checks, which are not enabled currently because it would differ from the original implementation. Change-Id: Ia7a7cc91ea3f20c9d76e39309daa7c97cd7ad5c6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Prepare for replacing Qt::Appearance with Qt::ColorSchemeTor Arne Vestbø2023-02-097-0/+28
| | | | | | | | | | | | | | Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. This patch is a first step, only introducing the new API, so that submodules can port over. The next step will be to remove the old API and transition the docs and platform themes. Pick-to: 6.5 Change-Id: I43cdb6bb1ccb49c535c06b1897821467fd83ca60 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QSysInfo: Work around erroneous warning output from WindowsMårten Nordheim2023-02-091-1/+14
| | | | | | | | | | | | | | | | | | | gethostname is in no way labeled deprecated, but it _tries_ to query some deprecated functionality, thus some warning like this is printed: "" LogHr(1) tid(6e14) 8007277C No such service is known. The service cannot be found in the specified name space. "" By using GetComputerNameEx we work around that. Bonus side effect is that it gives us UTF-16 right away so we save a conversion. Fixes: QTBUG-110468 Pick-to: 6.5 Change-Id: I3a370354d9cce50e3d89d125ce61fc9b619294cc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QDateTime: Fix inline use of deprecated ctorMårten Nordheim2023-02-091-1/+1
| | | | | | | | | | | FTBFS with clang-cl. Errors out due to no conversion between TimeSpec and TimeZone. Solution is simple: the default is LocalTime, so drop the 3rd argument. Change-Id: I27307f72680836b0a142aa49e5e9653996a0b2fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
* QRhi: fix potential ODR issue (operators for foreign types)Marc Mutz2023-02-092-15/+42
| | | | | | | | | | | | | | | | | | | | We mustn't define operators or hash functions for types we don't own, esp. not in a header file, because when someone else gets the same idea, we have an ODR violation, unless they get it token-for-token the same as our implementation. One option would be to replace the QHash with an STL container. Those can take per-container Hash and Equal function objects, so we wouldn't need to declare the global ones. But let's use a wrapper around the type on which we define the missing operators instead. As a drive-by, rename the arguments to the idiomatic lhs/rhs/key, from a/b/s. Change-Id: Ibbc2083bcd7423c5d443a0ca1b820cbecb241865 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QString: don't detach in insert(qsizetype, QUtf8StringView)Ahmad Samir2023-02-091-0/+16
| | | | | | | | | | | | | | If the string is shared, instead of detaching (which would copy the whole string data before doing the insertion), create a new string and copy characters to it as needed then swap it with "this". [ChangeLog][QtCore][QString] Inserting Utf8 data (e.g. a QUtf8StringView) into a currently shared QString is now done more efficiently. Task-number: QTBUG-106186 Change-Id: I832bde1494108685cc2f630750dfe9b38cd96931 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: optimize insert(qsizetype, QUtf8StringView)Ahmad Samir2023-02-092-2/+30
| | | | | | | | | | | Utf8 data is variable-width, ideally we want to write characters at most once, so insert directly into the QString buffer if inserting at the end (by delegating to append(QUtf8SV)), and use an intermediate buffer to hold the converted data before inserting anywhere else. Task-number: QTBUG-108546 Change-Id: Iabfaeecaf34a1ba11946bd67951e69a45d954d6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>