summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Port mimetypes away from QStringRefLars Knoll2020-06-117-8/+8
| | | | | | Task-number: QTBUG-84319 Change-Id: I2bed1149df7f11495fd9dc3577828c0790b17dab Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port QLocale::quoteString from QStringRef to QStringViewLars Knoll2020-06-115-15/+14
| | | | | | | Task-number: QTBUG-84319 Change-Id: I29726ebfda7a5f51a0a6ee29e905b0b904256c8d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Improve documentation for QLocale::FormatTypeKai Koehne2020-06-102-21/+33
| | | | | | | | | | | | | | | | LongFormat and ShortFormat are not limited to day and month names. Different locales might also use numbers for months instead of strings, so the example is a bit misleading. Instead of extending the enum description even more there's now examples in the dateFormat(), timeFormat(), dateTimeFormat() functions. Task-number: QTBUG-83841 Pick-to: 5.15 Change-Id: Icea2cbce7e9505d706a2171e7d1f4486abdb20be Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Long live std::pair!Giuseppe D'Angelo2020-06-1010-456/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QPair an alias for std::pair, and qMakePair just a forwarder towards std::make_pair. Why? Fundamentally to ditch a bunch of NIH code; gain for free structured bindings, std::tuple and std::reference_wrapper compatibility, and so on. Breakages: * Some that code manually forward declares QPair. We don't care about it (<QContainerFwd> is the proper way). * Some code that overloads on std::pair and QPair. Luckily it's mostly centralized: debug, metatypes, testing macros. Just remove the QPair overload. * Usages of qMakePair forcing the template type parameters. There are a handful of these in qtbase, but only one was actually broken. * std::pair is NOT (and will never likely be) trivially copiable. This is agreed to be a mistake done by practically all implementations in C++11, can can't be fixed without breaking ABI. Some code using QPair assuming it's trivially copiable may break; exactly one occurrence was in qtbase. * QMetaType logic extracts the type names in two different ways, one by looking at the source code string (e.g. extracted by moc) and one via some ad-hoc reflection in C++. We need to make "QPair" (as spelled in the source code) be the same as "std::pair" (gathered via reflection, which will see through the alias) when compared. The way it's already done e.g. for QList is by actually replacing the moc-extracted name with the name of the actual type used in C++; do the same here. On libc++, std::pair is actually in an inline namespace -- i.e. std::__1::pair; the reflection will extract and store "std::__1::pair" so we need an ad-hoc fix to QMetaType. [ChangeLog][QtCore][QPair] QPair is now an alias to std::pair, and does not exist as a class in Qt any more. This may break code such as functions overloaded for both QPair and std::pair. Usually, the overload taking a QPair can be safely discarded, leaving only the one taking a std::pair. QPair API has not changed, and qMakePair is still available for compatibility (although new code is encouraged to use std::pair and std::make_pair directly instead). Change-Id: I7725c751bf23946cde577b1406e86a336c0a3dcf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QLatin1String: add toString()Marc Mutz2020-06-102-0/+18
| | | | | | | | | For symmetry with other views. [ChangeLog][QtCore][QLatin1String] Added toString(). Change-Id: I4a0677e2dbd009e8da097f4cb0dbb27a6baf5469 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port QUrl away from QStringRefLars Knoll2020-06-101-9/+9
| | | | | | | Task-number: QTBUG-84319 Change-Id: I6167599ac86f17d37fbb6ea90d302641969b0f72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port QMetaObject away from QStringRefLars Knoll2020-06-101-3/+3
| | | | | | Task-number: QTBUG-84319 Change-Id: I905c2e1780a2ec42b1d189494bd5399e124df354 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QLibraryInfo from QStringRef to QStringViewLars Knoll2020-06-101-1/+1
| | | | | | Task-number: QTBUG-84319 Change-Id: I500e43e1918b22d636f11c915967e75223be9ef2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qGetPtrHelper: make it work with null d-pointersGiuseppe D'Angelo2020-06-101-1/+1
| | | | | | | | | operator-> comes with the precondition that the smart pointer is not null. Having null d-pointers is a valid use case, so enable it by using get() instead of operator->(). Change-Id: I78d77ca8c44e92a65ca98b15d0620bc3a1917ad2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Q(E)SDP: add get()Giuseppe D'Angelo2020-06-102-0/+21
| | | | | | | | | | [ChangeLog][QtCore][QSharedDataPointer] Added get() for STL compatibility. [ChangeLog][QtCore][QExplicitlySharedDataPointer] Added get() for STL compatibility. Change-Id: I1acb3b4f4bd70842ed53f6437be10404b67d9909 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* CMake: Fix libraries in qt_lib_XXX_private.pri files for NMCJoerg Bornemann2020-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | qmake_use.prf understands the _DEBUG and _RELEASE suffixes for QMAKE_LIBS_XXX entries. The CMake configuration "Debug" is considered for the _DEBUG entries, "Release" and "RelWithDebInfo" for _RELEASE. The qt_lib_XXX_private.pri files are now generated in multiple steps: 1. The QT_LIBS_XXX information is generated per $<CONFIG> and written to .cmake files. 2. A preliminary qt_lib_XXX_private.pri file is generated, containing only configuration-independent data. 3. A custom command runs the QtGenerateLibPri.cmake script that combines the files from step 1 and 2 into the final qt_lib_XXX_private.pri file. The same is done for mkspecs/qmodule.pri. To be able to trigger custom commands from header modules, which are interface libraries, we introduce one XXX_timestamp ALL target per header module that creates a timestamp file. To that XXX_timestamp target we add the pri file generation target as dependency. Fixes: QTBUG-84348 Change-Id: I610f279e37feeb7eceb9ef20b3ddfecff8cfbf81 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Ensure left/right/mid behave in a compatible wayLars Knoll2020-06-098-101/+135
| | | | | | | | | | | | | | | | | | | | QString and QStringRef did bounds checking for left/right/mid, whereas QStringView was asserting on out of bounds. Relax the behavior for QStringView and do bounds checking on pos/n as well. This removes a source of potentially hidden errors when porting from QStringRef (or QString) to QStringView. Unfortunately, one difference remains, where QByteArray::left/right() behaves differently (and somewhat more sane) than QString and QStringRef. We're keeping the difference here, as it has been around for many years. Mark left/right/mid as obsolete and to be replaced with the new first/last/slice methods. Change-Id: I18c203799ba78c928a4610a6038089f27696c22e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add QPromise implementationAndrei Golubev2020-06-095-1/+179
| | | | | | | | | | | | | | | | | | | | | | QPromise and QFuture created from it share the same internal state (namely, QFutureInterface object). QPromise provides high-level management of the shared resource, ensuring thread-safe behavior on construction and destruction (also taking into account QFuture::waitForFinished() semantics). QFuture acts as a primary controller of QPromise via action initiating methods such as suspend() or cancel(). QPromise is equipped with methods to check the status, but the actual handling of QFuture action "requests" is user-defined. [ChangeLog][QtCore][QPromise] Added QPromise class to accompany QFuture. It allows one to communicate computation results and progress to the QFuture via a shared state. Task-number: QTBUG-81586 Change-Id: Ibab9681d35fe63754bf394ad0e7923e2683e2457 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add since markers for the Qt::endl, etc.Albert Astals Cid2020-06-091-24/+72
| | | | | | | | | | | The Qt namespace was introduced in 461e89ee1a53f7669e0215f9015380c4a9d62371 which is only since 5.14 Also remove QTextStreamFunctions:: from the documentation of the deprecated functions since the QTextStreamFunctions namespace is a syntaxic workaround. Pick-to: 5.15 Change-Id: I9c15bcc49984bf5f5099c2f7df6b8adb3d2c61fb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* metatype: Do not try analyze T in Q*Pointer<T> if T is incompleteFabian Kosmale2020-06-091-1/+19
| | | | | Change-Id: I41737ce470f6d2b071ad5e85f8cad1da3869241c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QPointer: add get()Giuseppe D'Angelo2020-06-092-0/+9
| | | | | | | | [ChangeLog][QtCore][QPointer] Added get() for STL compatibility. Change-Id: I84bf9d58cd92e1bc74f731c3e9002031045f8f5c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QArrayData: stop using std::is_literal_typeGiuseppe D'Angelo2020-06-091-10/+2
| | | | | | | | The trait is deprecated in C++17 and removed in C++20. Enforce the same meaning by using a constexpr variable instead. Change-Id: Ief13afc3f889af09094391e626037778d879c4f5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QResource: Use some qUtf16Printable() instead of toLocal8Bit().data()hjk2020-06-081-6/+6
| | | | | Change-Id: Ia255052ea33e7d7fccb0627accd20315bbe5d393 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove deprecated text-related enumsEskil Abrahamsen Blomfeldt2020-06-082-5/+0
| | | | | | | | Fixes: QTBUG-82367 Change-Id: Iff2645759657f8e350754e90e791dbd583017671 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement first/last/from and slice() for string-like classesLars Knoll2020-06-086-3/+173
| | | | | | | | | | | | These methods are scheduled as a replacement for left/right/mid() in Qt 6 with a consistent, narrow contract that does not allow out of bounds indices, and therefore does permit faster implementations. Change-Id: Iabf22e8d4f3fef3c5e69a17f103e6cddebe420b1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSsl: port a local QStringList to QDuplicateTrackerMarc Mutz2020-06-081-0/+14
| | | | | | | | | | | | 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. The code is the first user of the collected data, so make that available by adding QDuplicateTracker::appendTo(Container&) methods. Change-Id: Ibd8810c0070db7e6b3ead6d6a569facdab88b646 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use static function instead of lambda to workaround a MSVC compiler bugFabian Kosmale2020-06-081-58/+70
| | | | | | | | | | | | The seemingly useless template parameters are needed to avoid a (distinct) bug in MSVC 2019 < 16.6, and should be removed once we have a newer version in the CI. Task-number: QTBUG-82945 Fixes: QTBUG-83600 Change-Id: I5b22a2259aa16ae90eca7d4f3bd2e4fa1116a73b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* ItemModels: remove deprecated functionsChristian Ehrlicher2020-06-075-129/+2
| | | | | Change-Id: Id3430493a62b11977f64e146f7668ca30935b959 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QAbstractItemModel: remove deprecated setRoleNames()Christian Ehrlicher2020-06-075-54/+13
| | | | | | | Remove setRoleNames() and all its now unneeded helper functions. Change-Id: I0a83751aace35700655d4cc7c79278325994cbdd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove winrtOliver Wolff2020-06-0663-3162/+180
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove unused argument from methodLars Knoll2020-06-061-31/+31
| | | | | | Task-number: QTBUG-84635 Change-Id: I9a1789e0481977e9fa26a915ff3bc776d0a37e75 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove unused function pointers in QVariant::HandlerLars Knoll2020-06-062-25/+0
| | | | | | Task-number: QTBUG-84635 Change-Id: Icfbd1aae26b0453426d93e0af64d84d6403b8e3b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QDir: port from QStringRef/split() to QStringView/tokenize()Marc Mutz2020-06-061-12/+28
| | | | | | | | | | | | Port away from random-access of the returned sequences. That's neither necessary nor does it make the code more readable than the alternative single-pass implementation used here. As a drive-by, make applying NRVO more likely by re-using the `result` variable for all returns after its declaration. Change-Id: I2c3bbaefa6b6f08ebf0b90fb7be62e3c6243f19d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QVariant: use std::addressof instead of operator&Giuseppe D'Angelo2020-06-061-1/+3
| | | | | Change-Id: If7172e9e0e213d99f0c54b387dde8f9e163109d0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QVariant: move and swap in the move assignment operatorGiuseppe D'Angelo2020-06-061-1/+1
| | | | | | | And not pure swap. As per policy, QVariant must leave the rhs empty. Change-Id: I2d5e0f584c4d4fffd05a0a5bfae27ddcb72430e9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QString/View: add tokenize() member functionsMarc Mutz2020-06-063-1/+74
| | | | | | | | | [ChangeLog][QtCore][QString, QStringView, QLatin1String] Added tokenize(). Change-Id: I5fbeab0ac1809ff2974e565129b61a6bdfb398bc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build without features.cborstreamwriterTasuku Suzuki2020-06-066-0/+12
| | | | | Change-Id: I970d21d7ac97a602a5f374f6c89cd4bfdcd847b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cmake: quote paths to prevent issues when no install prefix is setJean-Michaël Celerier2020-06-051-1/+1
| | | | | Change-Id: Ifa7f1ef70c4893e10cb4ce9a54d8a0806d19be93 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove QThreadPool::cancel()Allan Sandfeld Jensen2020-06-053-24/+0
| | | | | | | Deprecated in 5.9 Change-Id: Ib6e2a5da1e7ee2664fb6fa496bdc880fab870901 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix check for malformed input when decoding translationsVolker Hilsheimer2020-06-051-1/+1
| | | | | | | | | | | | | | | | Any integer modulo 1 can never be anything else but 0, so the statement could never be true. The intention is to abort in case of an odd number of bytes, as this would indicate malformed input that can't be decoded into a QString. Note that QTranslator will then silently continue to search for valid translations, and not print any error message at runtime, or otherwise inform the user or developer that an input message file contains malformed content. Change-Id: I957b337ee035f3aca013e0859f8ee70553d9a97b Coverity-Id: 11014 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Clean up docs of qbytearray.cpp's C-string functionsEdward Welbourne2020-06-051-20/+12
| | | | | | | | | | | | | | | Details of MSVC version became irrelevant some time ago; the code now just tests for MSVC. In any case, the reader doesn't need to know how the function is implemented, as long as it does what it claims to do. We do not, in fact, use a random number source when generating the return value for comparisons involving only one nullptr; we quite consistently treat the nullptr as less than the other string. Make explicit that this is true even if the other is empty. Change-Id: Ifd9b00fdf8e814fcf933a05821201670fecfd646 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Include qstringtokenizer.h from qstring.hMarc Mutz2020-06-051-0/+1
| | | | | | | | It's a bit annoying that you have to include <QStringTokenizer> to use the tokenize() methods. The separation is a historic artefact, just fix it. Change-Id: Ied4cc0c8dd2bb6735bf29fbb26fdbf47d07db264 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFactoryLoader: port a local QStringList to QDuplicateTrackerMarc Mutz2020-06-051-3/+3
| | | | | | | | | 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: I0a0d1e31fd35d483e0036045847a3759b593c71c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QProcess/Win: Fix build in debug modeAlex Trotsenko2020-06-052-3/+4
| | | | | | | | | | Suppress a compile warning: io\qprocess_win.cpp: 623:101: error: format '%d' expects argument of ... Pick-to: 5.15 Change-Id: I9ea94ddfc21afea5d1a78e264507a36435cce063 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Clean out string/character mentions from QByteArray docsEdward Welbourne2020-06-051-290/+276
| | | | | | | | | | | | | | | | | | | | | | In some places QByteArray does interpret bytes as characters and a sequence of them as a text string; everywhere else, however, it now refers to them as bytes. Add a section to the class doc explaining how char* pointers are interpreted; the handling of '\0'-termination is surely familiar to most readers, but making it explicit provides contrast for the explanation of there being no such special treatment of '\0' bytes when a stard address and length are given. Also mention in the class doc that interaction with QString is done via UTF-8 encoding and can be avoided by defining a macro. Shorten, in light of that, the description of that encoding where it appears in affected methods. In the process, clean up lots of phrasings. Change-Id: Ic97dce4a20752e277eeab35a06737322b2074692 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix references to section in QByteArray class doc after title changeEdward Welbourne2020-06-051-10/+6
| | | | | | | | | This amends commit 9dd8e655cdd26eeaae30645b7fe013d9a696547f to fix the various references to section {8-bit Character Conversions}, which is now renamed {Character Case}. Change-Id: I1f777ab359c616a1b12f05a12b1cd7397f3ccb18 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prune two un-needed #include files from qbytearray.cppEdward Welbourne2020-06-051-2/+0
| | | | | | | | The QByteArray code doesn't use QLocale or QString. Change-Id: I60966ecad35fdaaef9930ba2746bf732fa9f3cd7 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Create QLocale's default store if missing when setDefault() is calledEdward Welbourne2020-06-051-2/+10
| | | | | | | | | | | | | | | | | | | A check to prevent crash-on-exit if QLocale::setDefault() was called after the default store was torn down had the side-effect of causing setDefault() to not record data if it was called before the first access to the default store caused it to come into being. Change the check to test that the default store has been destroyed and, if not, create it if it doesn't exist yet. This refines commit 4d6572aac0eb1f75f3c810ce8e92635b956d29fc (as modified by commit 11c5c078c7743050a115a4dcc31f52caaa378e35). Fixes: QTBUG-83016 Fixes: QTBUG-83415 Pick-to: 5.15 Change-Id: Icbce9bd9c75d0258d403e2f90957561b5a18bdf3 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QSettings from QStringRef to QStringViewLars Knoll2020-06-053-10/+10
| | | | | | Task-number: QTBUG-84319 Change-Id: If2b5d8eb78ab5ca78d365f137d9680b1f0646c6b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build without features.shortcutTasuku Suzuki2020-06-051-0/+2
| | | | | Change-Id: I5b0d3b169c7adb3ee340df7b593f84167f1ccc0c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Clean up headersTor Arne Vestbø2020-06-052-19/+48
| | | | | | | | | | | | | | The headers are now C++ clean and can be used outside of Objective-C code. All includes of Objective-C frameworks have been moved to the implementation files. Header guards have been added in the few places they were missing. All includes are now done via #include, instead of sometimes using the #import variant. Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Enforce two's complement integersGiuseppe D'Angelo2020-06-041-0/+4
| | | | | | | | | | | C++20 will make this true for everyone, but as far as Qt goes, this has to apply to all platforms even before that. Just add another couple of checks to the list. Change-Id: I0251ce431d4584380cfd3fc3e4b36f1dbdbf9df2 Pick-to: 5.15 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the pause-related APIs of QFuture* classesSona Kurazyan2020-06-047-88/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated the pause-related APIs of QFuture* classes and added alternatives having "suspend" in the name instead. With 2f15927f01ceef0aca490746302a5ea57ea9441c new isSuspended()/suspended() APIs have been added to QFuture* classes for checking if pause/suspension is still in progress or it already took effect. To keep the naming more consistent, renamed: - setPaused() -> setSuspended() - pause() -> suspend() - togglePaused() -> toggleSuspended() - QFutureWatcher::paused() -> QFutureWatcher::suspending() Note that QFuture*::isPaused() now corresponds to (isSuspending() || isSuspended()). [ChangeLog][Deprecation Notice] Deprecated pause-related APIs of QFuture and QFutureWatcher. Added alternatives having "suspend" in the name instead. Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* QNX: assume QNX is always UTF-8Samuli Piippo2020-06-041-1/+2
| | | | | | | | | | | Override locale encoding to UTF-8 on supported platforms. QNX has nl_langinfo, but the header is not using extern "C". Tests show that it returns UTF-8 regardless of the locale, so let's assume it's always UTF-8. Change-Id: I0fe98f8441287df9f99c334e537a7b962df105f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Limit QByteArray's 8-bit support to ASCIIEdward Welbourne2020-06-042-154/+129
| | | | | | | | | | | | | | | | | | | | | Previously it handled Latin-1, which made it incompatible with UTF-8, which is now our preferred 8-bit encoding. For Qt6 it is limited to ASCII. Adjusted tests to match. QLatin1String::compare() turned out to be relying on qstrnicmp()'s Latin-1 handling. Removed some spurious Q_UNLIKELY()s and tidied up code a little in the process. [ChangeLog][QtCore][Important Behavior Changes] Encoding-dependent features of QByteArrray are now limited to ASCII, where previously they worked for the whole of Latin-1. This affects case-insensitive comparison, notably including qstricmp() and qstrnicmp(), and case-transforming functions. Fixes: QTBUG-84323 Change-Id: I2925d9908f8654599195a2860847b17083911b41 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>