summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Correct feature test in tst_qtranslator's CMake configEdward Welbourne2023-07-271-1/+1
| | | | | | | | | There is no QT_CONFIG_thread. Thanks to Alexey Edelev for spotting why I couldn't run the test. Pick-to: 6.6 6.5 Change-Id: I11c99d9b1ff8fed67b118028b76fba8ee6db3c42 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* windeployqt: Do not deploy insighttracker plugin by defaultOliver Wolff2023-07-271-4/+25
| | | | | | | | | | | | | | | | Qt insight's TP is using plugin type "generic" so that insight plugins can be deployed for every Qt application. As "generic" plugins are part of QtGui windeployqt deploys these if a dependency to QtGui is found. As defaulting to a deployment of insight plugins might cause confusion among users, we make deployment of these plugins explicit if the module is available. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I9d2a8595373d5a15b7afbeaf7174226563b1cb6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Timothée Keller <timothee.keller@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Socketpair is not supported on VxworksMarcin Zdunek2023-07-271-0/+4
| | | | | Change-Id: I7cfebfc85933ace1e449860b29c8ec85201690a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: temporarily skip tst_qprinterinfo, tst_qwidget and tst_qwindowAssam Boudjelthia2023-07-263-0/+12
| | | | | | | | | | | Those tests often fail on Android 13 on RHEL 8.6 and 8.8. This patch skips them to unblock CI while the underlying reasons are investigated and fixed. Task-number: QTQAINFRA-5606 Change-Id: If088d69c2160470ef50b2e74cd9b9399451c526d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Remove deprecated sync.profileAlexey Edelev2023-07-261-85/+0
| | | | | | Task-number: QTBUG-112418 Change-Id: I53e81c5aca175d178f6e46d6a7fb18f4749c62bd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make sure to follow BuildInternals CMAKE_BUILD_TYPE on WindowsAlexandru Croitor2023-07-262-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | A regression was introduced in 48841c34d2e86a741ec9992b9704c0fa5973503c when configuring qtshadertools with -prefix -debug and no -developer-build. qtbase would have been built as Debug, but qtshadertools as release. This caused qsb.exe to link to a debug c++ runtime via QtCore, and a release one via QtShaderTools libraries and thus cause heap corruption crashes during runtime due to the mismatch. This happened because the check in cmake/QtSetup.cmake thought Debug was the default build type (nothing was specified on the command line) without knowing it was explicitly set BuildInternals. Set a variable when BuildInternals sets CMAKE_BUILD_TYPE and make sure QtSetup does not override it then. Augments 33af62db3747bb6fcb7490ef2d2abc5bb53925b6 Amends 48841c34d2e86a741ec9992b9704c0fa5973503c Fixes: QTBUG-114958 Change-Id: I5e0a27b4d77512494c026dd911ec5757889a5a1a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Refine minor details in Darwin time-zone backendEdward Welbourne2023-07-261-4/+5
| | | | | | | | | | | | It's Darwin, no longer OS X. Include a link to the URL of NSTimeZone's docs. Use actuall Q_UNREACHABLE() rather than a comment. Correct a TODO comment (there *is* API for it, but fiddly). Make a lower bound constexpr rather than merely const. Task-number: QTBUG-104012 Change-Id: I9bf2018fa27ac9f6aa38eaebbf6b0f90ff5f6188 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't include resolv.h when libresolv is disabledJacek Poplawski2023-07-261-1/+4
| | | | | Change-Id: I5b216ed02452549b69847b34139613669905023c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* VxWorks does not have byteswap.hJacek Poplawski2023-07-262-6/+15
| | | | | Change-Id: I9927fa64e76d59415d4974538383321c6dd6318b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOpenGLWidget: invalidate the depth/stencil after renderingGiuseppe D'Angelo2023-07-261-18/+39
| | | | | | | | | We don't need them any more, only the color is used for compositing. In principle this enables a driver to not writeback their contents into main memory. Change-Id: Ibde17af6c14c98ebdca956aaf902dfd728f9219c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QSet: document removeIfGiuseppe D'Angelo2023-07-251-0/+9
| | | | | | | | | The docs were never added (unlike the docs for erase_if). Change-Id: I7857c5eded68791ddfc4e6ce42a60d5736f5a438 Pick-to: 6.2 6.5 6.6 Fixes: QTBUG-115473 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOpenGLWidget: use (and prefer) InvalidateFramebufferGiuseppe D'Angelo2023-07-253-14/+25
| | | | | | | | | | | | | | | | | | | | Desktop GL does not have the GL_EXT_discard_framebuffer extension at all. Instead, it may have GL_ARB_invalidate_subdata. Furthermore, GLES >= 3.0 and GL >= 4.3 both support FBO invalidation through glInvalidateFramebuffer. Extend the semantics of OpenGLExtension::DiscardFramebuffer to mean that *any* possibility above is supported, and wrap it in a helper function that calls whatever support is present. (This is all private API anyhow.) Technically speaking glInvalidateFramebuffer supports a superset of what glDiscardFramebufferEXT supports, but we never use such superset, and the two APIs are otherwise identical. Then, make QOpenGLWidget call that wrapper. Change-Id: I64e042daf51493d3834c3ba1b53ae6e224bbc4ed Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* COIN/Android: Move android_emulator_launcher.sh to qt5.gitAssam Boudjelthia2023-07-255-116/+3
| | | | | | | | | | | | | | | | The android emulator launcher script is mainly used in CI and thus makes sense to be moved there. This also makes it easier to make changes without having to wait for submodule updates. ANDROID_EMULATOR_RUNNER is defined in qt5's Android provisioning script. Also, change the order of instructions execution to set COIN_CTEST_RESULTSDIR env variable before running the emulator script. That var points to the path to where the emulator logs are saved. Task-number: QTQAINFRA-5596 Change-Id: If6ac285fecdc49611c398e8185e6e3e6b9c353fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QIntegerForSize: fix check for 128-bit intsIvan Solovev2023-07-251-1/+1
| | | | | | | | | We do not need the Q_CC_GNU check, as the __SIZEOF_INT128__ check is enough. Pick-to: 6.6 Change-Id: I12bdd02186c4f5dad0ab3f4596f4b37e5c3f7eee Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make qYieldCpu() public APIThiago Macieira2023-07-259-47/+134
| | | | | | | | | | | Rewritten to be a bit simpler, added a few more yield/YieldProcessor alternatives, added RISC-V support. [ChangeLog][QtCore] Added qYieldCpu() function. Fixes: QTBUG-103014 Change-Id: I53335f845a1345299031fffd176f59032e7400f5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QProperty: improve QPropertyAlias deprecationIvan Solovev2023-07-253-4/+13
| | | | | | | | | | | Use QT_DEPRECATED_VERSION_X_6_6 and provide reasons for deprecation for the enum value and for the QPropertyObserver constructor. Pick-to: 6.6 Change-Id: I0f9b4c6dc8bb9fd5eac692a6953c90059f3c77ef Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: add overview page for Qt's comparison typesDennis Oberst2023-07-251-3/+91
| | | | | | | | | | | Provide a centralized overview of Qt's comparison types, available for three-way comparisons. Fixes: QTBUG-114402 Change-Id: Ib7229e753ef750d00c208794d1feb3e6d42133ad Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Add case for VxWorks platform in initLocale methodKrzysztof Sommerfeld2023-07-251-0/+2
| | | | | Change-Id: Ic0cef59d452c72340f6216c9ae3c261a24c2d296 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNativeIpcKey: add qHash() functionDennis Oberst2023-07-253-0/+29
| | | | | | | | Equality comparable types should define a qHash() function. Pick-to: 6.6 Change-Id: I1677fbefa3d09d49a292d369b808793f884c32e9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing \l to DOM bookmarks exampleEdward Welbourne2023-07-251-1/+1
| | | | | | | | | It tried to reference the QXmlStream equivalent example, putting its title in {...}, but neglected the \l prefix to that. Change-Id: Iedc556ecd65103057d0dea65debe628b50d1190e Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
* Add QStrongOrdering and QWeakOrderingDennis Oberst2023-07-253-21/+985
| | | | | | | | | | | | | | These new classes align with the criteria of std::strong_ordering and std::weak_ordering and were the missing types required by the three-way comparison operator. References: https://en.cppreference.com/w/cpp/utility/compare/strong_ordering https://en.cppreference.com/w/cpp/utility/compare/weak_ordering Change-Id: Ie6620ca98103800fd5504810dc5689c1dd1c2972 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Clarify QElapsedTimer::hasExpired()'s documentationEdward Welbourne2023-07-251-4/+6
| | | | | | | | | | | The description in terms of timeouts was confusing. Instead, say what it actually does, in plain terms. Mention that you can do similar for a duration. Pick-to: 6.6 Task-number: QTBUG-115447 Change-Id: I4618d7fa290e7959ed3cb51e5c2576b041f77091 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QExplicitlySharedDataPointer: Remove stray commentAxel Spoerl2023-07-251-1/+0
| | | | | | | | Remove stray comment at the end of tst_qexplicitlyshareddatapointer.cpp Pick-to: 6.6 Change-Id: I31a6c38002e56e7c43e527864ba3d9324950079f Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* tst_QXmlStream: Remove stray commentAxel Spoerl2023-07-251-1/+0
| | | | | | | | Remove stray comment at the end of tst_qxmlstream.cpp Pick-to: 6.6 Change-Id: I88550e2b75194e7895d8578ca0e8350af59d4dfe Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* tst_QLocale: add testing of the extremes for doubleToStringThiago Macieira2023-07-241-0/+46
| | | | | Change-Id: I5f7f427ded124479baa6fffd1760b1ec36e7e827 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove include ipc.h as it is no longer neededJacek Poplawski2023-07-241-4/+0
| | | | | Change-Id: I8b7c6744794f4369d6e27fdb454a059727413d9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPipe & QEvent: use a simpler atomic operationThiago Macieira2023-07-242-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This causes modern compilers (i.e., not MSVC) to emit a single bit-test-and-set instruction instead of a cmpxchg. It's still an atomic operation, so it's not that much faster (if at all), but it has simpler encoding. Previous: 000000000026bca0 <QEventDispatcherUNIX::wakeUp()>: 26bca0: mov 0x8(%rdi),%rdx 26bca4: xor %eax,%eax 26bca6: mov $0x1,%ecx 26bcab: lock cmpxchg %ecx,0x98(%rdx) 26bcb3: jne 26bcc5 <QEventDispatcherUNIX::wakeUp()+0x25> 26bcb5: mov 0x90(%rdx),%edi 26bcbb: mov $0x1,%esi 26bcc0: jmp c01d0 <eventfd_write@plt> 26bcc5: ret Now: 26b3a0: mov 0x8(%rdi),%rax 26b3a4: lock btsl $0x0,0x98(%rax) 26b3ad: jae 26b3b0 <QEventDispatcherUNIX::wakeUp()+0x10> 26b3af: ret 26b3b0: mov 0x90(%rax),%edi 26b3b6: mov $0x1,%esi 26b3bb: jmp c11d0 <eventfd_write@plt> Change-Id: I53335f845a1345299031fffd176fa8ac1de3ad13 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QEventDispatcherUNIX: remove the fallback to pipes on eventfd systemsThiago Macieira2023-07-242-26/+15
| | | | | | | | | | | | | | | | | Linux has had it since 2.6.23, which is positively ancient from our perspective. No one runs Qt on systems anywhere near that old (I'd be amazed if anyone managed on CentOS / RHEL 7, which carries Linux 3.10). And we don't deal with ENOSYS on FreeBSD either. The removal is accomplished by dead code elimination: it's still compiled on Linux and FreeBSD. Drive-by - use NSDMI in QThreadPipe - remove EINTR_LOOP for eventfd_write(3): it can't be interrupted Change-Id: I63b988479db546dabffcfffd1766e2c7acc6da46 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QEventDispatcherUNIX: clean up old cruftThiago Macieira2023-07-241-10/+0
| | | | | | | All the timing related code is gone. Change-Id: I63b988479db546dabffcfffd1766e1f2618650c1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QEventDispatcherUNIX: convert "eventfd" feature to proper QT_CONFIGThiago Macieira2023-07-242-6/+5
| | | | | | | | | | | And mark it private. [ChangeLog][QtCore] Qt no longer sets the QT_NO_EVENTFD feature macro on systems without eventfd. Change-Id: I63b988479db546dabffcfffd1766e1df5255c930 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Fix installed metatypes not being propagated to other reposAlexandru Croitor2023-07-241-3/+1
| | | | | | | | | | | | | | | | | | | | | The install-time code path that's supposed to propagate and install the metatypes files was never executed, because of a wrong PARENT_SCOPE assignment and because the code was overriding the meta type file name retrieved from a property with an empty non-existent argument. This caused build failures in qtdeclarative when qmlcachegen generated invalid cpp code without having access to the qtbase foreign types. This only happened in prefix builds. Use the appropriate variable for the PARENT_SCOPE assignment and remove the incorrect file name assignment. Amends c45c32af32e5b7501065f294de67a5e6a3d1f62a Task-number: QTBUG-115152 Change-Id: I120d53d44382a1ac6f62792ec1620add3e7b136c Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* QColorDialog: React to HSV values during manual edit instead of changeAxel Spoerl2023-07-241-1/+1
| | | | | | | | | | | | | | The existing signal connection can cause a loop and undefined behavior in the interaction between the line edit for a hex rgb color and the individual rgb values. => Change connection to textEdited, to react only on manual editing. Fixes: QTBUG-115189 Pick-to: 6.6 6.5 Change-Id: Ie3062c575652b905a8ab16edb2f5f77f8d150f36 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QXmlStreamReader: Fix translation context of error messagesFriedemann Kleint2023-07-241-2/+2
| | | | | | | | | | | | QObject::tr() should not be used. Amends c4301be7d5f94852e1b17f2c2989d5ca807855d4. Task-number: QTBUG-92113 Task-number: QTBUG-95188 Pick-to: 6.6 6.5 Change-Id: I09547c3d048d6b3726e33be74b06035f0eec4f31 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Move the selenium qwasmwindow test to the selenium dirMikolaj Boc2023-07-245-1/+1
| | | | | | | | This is done in anticipation of another test for dragging Change-Id: I56961eb1d16a4a6b6c58890c9c882dea813dfa08 Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Use new entry function name in qwasmwindow testMikolaj Boc2023-07-241-1/+1
| | | | | | | | Use qwasmwindow_harness_entry instead of the old createQtAppInstance. Change-Id: I381dd43d9144fe70f055c19db4cd95f90313883b Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Fix issue with qstorageinfo_unix.cpp not working on VxworksMarcin Zdunek2023-07-242-3/+37
| | | | | | | | | Problem was, that qstorageinfo_unix.cpp is using sys/statvfs.h header, but this header is not available in Vxworks(Vxworks has its own /sys/ directory).As this feature is not there in Vxworks, we are using a "_stub" file to omit whole implementation. This is the same solution as it was used for Qt5 for Vxworks. Change-Id: I1bc5a576e63f403c923cbc93571967184677305f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove usleep(), getpagesize() and getpwuid() from qfunctions_vxworksJacek Poplawski2023-07-242-49/+0
| | | | | | | This functionality is now available in VSB Change-Id: I761d73d8ae100b2e0eae8101479b325ddcbde6cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringBuilder: test more concatenation variantsAhmad Samir2023-07-241-0/+47
| | | | | | | | | | | | | | - rvalues, they work due to e.g. the implicit conversion to QString, so the compiler picks the "const String &" overloads. (This may change by adding rvalue overloads in a later commit, although that will mean adding many more operator+() overloads to disambiguate the calls) - QByteArray + QByteArrayView - More P and more Q (even though in some cases P and Q are defined as the same operator in some QStringBuilder unittest "scenarios") Change-Id: I4e7daecdb6887fb52f45732cd32323af20b1b850 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QValidator: return State::Intermediate for certain trailing charactersAhmad Samir2023-07-243-4/+8
| | | | | | | | | | | | | | | | | E.g. a group separator, a -/+ sign, or 'e' (exponent). Input ending with one of these characters now returns Intermediate, as it can become Acceptable if the user types more characters. Remove a check from initialResultCheck(), as it's now covered by QLocaleData::validateChars() checking that the last character in the buffer is -/+, this works the same if buffer's size is 1. Extended unittests based on the linked bug report; the other cases for "last" are already covered by existing unittests. Task-number: QTBUG-111371 Change-Id: I9b6979c29f07a5f57b040004cd3dbf4e27147c21 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* SQLDatabase: merge two global statics into oneChristian Ehrlicher2023-07-231-84/+51
| | | | | | | Merge the two global statics into one. Change-Id: I8a93ba848abe31527551313c8a4a449d05e3d680 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* SQL/PSQL: Handle jsonb operators in prepared queriesChristian Ehrlicher2023-07-237-3/+146
| | | | | | | | | | | | Add an option to disable handling of positional binding so jsonb operators are not screwed up [ChangeLog][QtSql][QSqlQuery] Add setEnablePositionalBinding() to be able to disable positional binding. Fixes: QTBUG-96636 Change-Id: I428a9d3b10274b97292ab86a74d9b3971d6f10e9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QTimer: add note about QT_NO_CONTEXTLESS_CONNECT to callOnTimeout docsAhmad Samir2023-07-231-2/+7
| | | | | | | | | Drive-by change: use \code, better formatting especially for longer lines of code. Change-Id: I90dbde17a5bea276c86304bff64027dd9d248a21 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimer: fix API docs of callOnTimeOut overloadAhmad Samir2023-07-232-6/+8
| | | | | | | | | | | | | | | | | | | | It actually takes one parameter, because in this overload the connection type can't be specified, for example: QTimer timer; timer.callOnTimeout([]() { qDebug() << "slot"; }); The call chain is: QObject::connect(timer, &QTimer::timeout, functor); connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 &&slot) connect(sender, signal, sender, std::forward<Func2>(slot), Qt::DirectConnection); the connection type is always DirectConnection. Spotted by Giuseppe in code review. Pick-to: 6.6 6.5 5.15 Change-Id: Ia8bbd91e98a357244cbfae4e3ed63d4c73038fa2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QLocaleData:: port bytearray/stringTo{U}LongLong to QSimpleParsedNumberAhmad Samir2023-07-225-53/+54
| | | | | | Change-Id: I97fe38d9b676cf92003a7323ebb5f56b9b79abad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QLocale: move QSimpleParsedNumber to qlocale_p.hAhmad Samir2023-07-222-8/+8
| | | | | | | | It was defined in qlocale_tools_p.h which already includes qlocale_p.h. Change-Id: I43464a27ec15266ce8632ca30dcd1c57d94b1f25 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocaleData: change validateChars() to return validation StateAhmad Samir2023-07-223-37/+57
| | | | | | | | | | | | | | | | | | | | Instead of returning just bool, return a result struct {State, CharBuff}, a State is useful as it can have an Intermediate state where the input isn't Acceptable yet, but not Invalid as such. The example from the linked bug is in tst_QIntValidator::validateFrench(), a string "1 ", which can be interpretted as a number with a group separator, but the input shouldn't end with a group separator (changing the unittest will be done as part of a separate commit). CharBuff (QVarLengthArray<char, 256>) replaces the QByteArray input parameter; a QVarLengthArray means no heap allocation in typical use-cases with input text < 256 characters to validate. This required minimum changes (QVLA doesn't have startsWith, replaced by comparing with buff[0]; and for converting to double, wrapped it in a QBAV). Task-number: QTBUG-111371 Change-Id: I4e0eb612d470ef03faf52031ddfe9c4bdb31e1e1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QValidator: de-duplicate some codeAhmad Samir2023-07-221-22/+24
| | | | | | | | | | | | | QDoubleValidator didn't return Intermediate if the buffer only had one character, - or +, but it makes sense to check that there too. In a later commit that check will be moved to QLocaleData::validateChars (which will return "Intermediate" if the last character in the result buffer is -/+, in this case it's the last and only character in the buffer). Change-Id: I2f9f5b92880b7e9cc1a3ab36b5ec322f57291ee9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qstringalgorithms: refactor trimmed_helper_positionsAhmad Samir2023-07-223-11/+16
| | | | | | | | | Take by const Str&, trimming a container/view of characters means removing whitespace from the beginning and end, so the two args were always cbegin() and cend(). Change-Id: Iac0eda59341f1981204d11013d591013eae3c4e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QByteArray: add trimmed() unittestAhmad Samir2023-07-221-0/+35
| | | | | Change-Id: Ib0e808ea45bb68fb0ec79da2f32959677eae988f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: use _data based testing for trimmedAhmad Samir2023-07-221-21/+29
| | | | | | | The same _data() will be re-used with trim(). Change-Id: Ie9b794b7e8d40552d9cacb71df0f8a151d4348a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>