summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Increase timeout of slow test for ASAN-enabled buildDimitrios Apostolou2022-06-151-0/+4
| | | | | Change-Id: Iea0802220701501f18822a5eb1f1b0c22f62e705 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix typos in docs and commentsKai Köhne2022-06-157-9/+9
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make two QDT benchmarks data-driven and add more rowsEdward Welbourne2022-06-151-60/+40
| | | | | | | | | | | | | | | | | | The QDateTime benchmark's toMSecsSinceEpoch() and toMSecsSinceEpochTz() each iterated the 2010s and had 1950 and 2050 variants for two other decades. I want to also test some earlier decades and do similar for create(), so combine the existing triplets as three rows of a data-driven test for each triplet, add the new rows and apply the same to create(). In the process, turn an enum used for qint64 constants into a set of constexpr qint64 declarations. Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-104012 Change-Id: I2657346b65d96a7ef7503cd33c870b688ea5dbff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add support for painting at integer DPR with downscaleMorten Sørvig2022-06-141-2/+7
| | | | | | | | | | | | | | | | | | | Enable by setting QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1. This will make the backing store and painter operate at the next highest integer DPR in cases where QWindow::devicePixelRatio() returns a fractional value. The backing store image will then be downscaled to the target DPR at flush time, using the RHI flush pipeline. [ChangeLog][QWidgets] Added experimental support for always painting at an integer device pixel ratio (rounding the DPR up if necessary), followed by a downscale to the target DPR.Enable by setting QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1. Pick-to: 6.4 Task-number: QTBUG-86344 Change-Id: Id5b834a0e3499818b0b656161f5e0c38a6caa340 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use consistent ordering in QShaderLaszlo Agocs2022-06-141-0/+11
| | | | | | | Fixes: QTBUG-101923 Change-Id: I62df3eba773350e47ed650acb00bc42b3ce6a899 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Revert "qxp::function_ref: drop use of q23::invoke_r"Marc Mutz2022-06-141-0/+40
| | | | | | | | | | | | | | | | | | | | This reverts commit b9cce12e76796962e5e5ad0d5408370af56af459, which broke function_ref<void(int)> f = [](int i) { return i; }; ie. swallowing of return types. We could maybe implement the same without invoke_r, with the same manual if-constexpr that invoke_r has, but it would be a pointless duplication across the two thunks we have, so just use invoke_r. Add tests. Pick-to: 6.4 Task-number: QTBUG-103739 Change-Id: I6034f05d813c06a25e8058ded5b6b62f3ca858b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QResourceManager: extend the test to cover open filesMarc Mutz2022-06-141-0/+9
| | | | | | | | | ... when unregistering. Task-number: QTBUG-86088 Change-Id: I11112142ef1d8c4b269089a0a82ca06a5e434f7e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* tst_QAnyStringView: explicitly check the spaceship operatorMarc Mutz2022-06-141-0/+31
| | | | | | | | | | | | | | | We implicitly checked it, because, in C++20 builds, the non-equality relational operators are synthesized from it by the compiler, and we test those, but we didn't check that <=> returns strong_ordering. We now do. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104108 Change-Id: Ieb19a2d4cb2d600d884f4e2e89e98c6187e23872 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Don't crash when removing the last visible tabVolker Hilsheimer2022-06-131-0/+34
| | | | | | | | | | | | | | | | | | | | The code incorrectly tried to ensure that the firstVisible tab was a valid index, even though there might not be any visible tab left after removing the last visible tab. The same logic didn't exist of the lastVisible tab, so we tripped the assert in qBound, as max (being -1) ended up smaller than min (0). Fix this by removing the wrong correcting of firstVisible to be always valid. Make sure we emit currentChanged with -1 when no visible tab is left after removing the current tab. Add a test. Fixes: QTBUG-104003 Pick-to: 6.3 6.2 Change-Id: I27e6438a02d0a0f1ac4d0e0160cee4f33b3f3766 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Update window geometry when QWindow::m{in|ax}imumSize is updatedJan Arve Sæther2022-06-131-0/+11
| | | | | | | | | | | | | | | | | | | | More specifically, if either minimum or maximum size are updated, make sure that the current window geometry is updated so that it is within the minimum and maximum sizes. Previously, these constraints was only respected by the window manager when the user resized the window. For widgets this already worked, because a top-level widget will take care of respecting these constraints if they are changed. Since QWindow::setMinimumSize and QWindow::setMaximumSize started to share so many common things, a new function (setMinOrMaxSize_helper()) is added. Task-number: QTBUG-102771 Change-Id: Ia4b2680dcf865f84a3cf6424187f9a6036b76386 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use CSS classes on html list items for checkbox supportShawn Rutledge2022-06-112-14/+30
| | | | | | | | | | | | | | If we replace the bullet character with a UC checkbox character, it looks ok in a browser, and the HTML parser can recover the BlockMarker attribute from the css class. [ChangeLog][QtGui][Text] Checkbox list items can now be read and written in both HTML and Markdown, including conversions. Task-number: QTBUG-103714 Change-Id: Ic6b74512075cd4ac16d6f80fdf55b221447491a9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QNetworkReply: Fix the test compilationLaszlo Papp2022-06-101-0/+1
| | | | | | | | | | It would not compile on my Linux box due to using QVariantMap, but not actually including QMap itself. Using gcc 9.3.1 on CentOS 7. Pick-to: 6.3 6.4 Change-Id: I808a270c814a906030cb34b197d3a2a85ba384e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* Windows: fix DeferredDelete events processing on QThread::terminate()Vladimir Belyavsky2022-06-101-0/+78
| | | | | | | | | | | | On finishing/terminating a thread, when processing posted events, we need to consider QThread's own data instead of caller thread's data. Otherwise we can get into unexpected situations such as double destruction of an object, premature destruction, etc. Fixes: QTBUG-103922 Pick-to: 6.4 6.3 6.3.1 6.2 5.15 Change-Id: Idf77221ebbaa0b150ee2d0c296b51829ae8dc30e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* FatalSignalHandler: print the signal name on crashThiago Macieira2022-06-082-2/+2
| | | | | | | | | | | | | It's easier to remember what "SIGSEGV" means instead of "11". GNU libc has offered sigabbrev_np() (non-portable) since 2.32; for older libcs, we'll be happy with a hardcoded list. Selftest updated to match... though it didn't seem to be necessary. Pick-to: 6.4 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16ebc66ecf6e9465 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update Catch2 to v2.13.9Marc Mutz2022-06-081-5/+9
| | | | | | | | | Two patches applied to upstream release. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-103732 Change-Id: Id64b65c4567433806047a2a34fa85ab5f260e6cc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_QTcpServer: Make test-helper a dependencyMårten Nordheim2022-06-072-1/+5
| | | | | | | | For convenience. Change-Id: I91017e4b05b3c64f8628f23a0a3cf7abd4b4d686 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tst_qfile: skip trash bin test on webOSJanne Juntunen2022-06-071-2/+2
| | | | | | | | | | Skipping moveToTrash() test is needed because WebOS does not implement a trash bin directory. Fixes: QTBUG-104053 Pick-to: 6.4 Change-Id: Id1d1595eb401d8ef3a403c915d95be1cd75368d2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Bump version to 6.5.0Jani Heikkinen2022-06-063-3/+3
| | | | | Change-Id: I83a4f915a914bdc18f6706bb902f3e3b13da074f Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Support cosmetic brush patterns in the pdf and opengl paint enginesEirik Aavitsland2022-06-043-2/+85
| | | | | | | | | | | | | | | | | | This implements the recent functionality extension of painting cosmetic (untransformed) brush patterns, and the corresponding NonCosmeticBrushPatterns render hint, in the pdf and opengl paint engines. As part of the implementation it also fixes a couple of pre-existing bugs in the opengl engine, relating to updating the brush after changes in transformation or brush origin. As a driveby, it also includes a minor fix for the lance testing tool: request stencil buffer, as that is needed and not always provided by default. This echoes a recent fix done to tst_baseline_painting. Change-Id: Ia8811477e015eebeb40ed138bca96643ce1ab0dc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QTest::toString benchmark: do not pass a template type parameterGiuseppe D'Angelo2022-06-041-1/+1
| | | | | | | | Let it to be deduced, otherwise it may force instantiations which are ill-formed. Change-Id: I3ce674128d96a48ad6883e265734ff330645dd75 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Unify QSslServer from QtWebSockets and QtHttpServer into QtNetworkØystein Heskestad2022-06-047-0/+551
| | | | | | | | | | | | | Both QtWeSockets and QtHttpServer has a QSslServer class that is useful elsewhere. They are different though, so the new class has features from both versions. [ChangeLog][QtNetwork] Unify QSslServer from QtWebSockets and QtHttpServer into QtNetwork Task-number: QTBUG-100823 Change-Id: I523f04db39297ceb9b258f673eb12deecfc6886c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* The new signal pendingConnectionAvailable is added to QTcpServerØystein Heskestad2022-06-041-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | The new signal pendingConnnectionAvailable is emitted after a new connection has been added to the pending connections queue. Connect to this signal and call nextPendingConnection to handle incoming connections. The existing unchanged newConnection signal is emitted after the overridable function incomingConnection is called, regardless of whether a new connection is added to the pending connections queue in the incomingConnection function or not. If a subclass that overrides incomingConnection either decides to not add all incoming connections to the pending connections queue, or to postpone adding the connection until a handshake is successfully completed, the pendingConnectionAvailable signal should be to used, because this signal directly corresponds to insertions to the pending connections queue. [ChangeLog][QtNetwork][QTcpServer] New signal pendingConnectionAvailable is emitted when a new connection is added Task-number: QTBUG-100823 Change-Id: I00c76761389065f68271553e69e6c45c393a2fa8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QTestLib: rework QTest::compare_helper()Ivan Solovev2022-06-038-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QTestLib] QCOMPARE now evaluates toString() on its arguments lazily, speeding up the general case where the comparison doesn't fail. This is true for the QCOMPARE functionality provided by Qt. If you specialized qCompare() for your own types, then you need to change its implementation in line with Qt's own qCompare() specializations in order to enable this feature. [ChangeLog][QTestLib] QCOMPARE calls with nullptr argument(s) will now print the actual and expected values upon failure. Previously it was not like that because of the compareHelper() overload in qtestresult.cpp that treated the presence of nullptr-arguments as a reason to ignore formatFailMessage() call. New implementation does not have this check, and correctly executes formatFailMessage() for all arguments. Note that the qCompare() overloads that call QTestResult::compare() internally were not affected by this patch, because they already defer toString() invocation until the comparison fails. Some numbers, collected against shared release developer build. I checked how this change affects the test execution. The idea was to pick some tests for types that do not have a specific QTestResult::compare overload, so I picked a couple of QByteArray tests. The comparison is done by running a test 10 times and taking the average execution duration, as reported in the log. tst_qbytearrayapisymmetry: Before: 15.6 ms After: 14.2 ms tst_qbytearray: Before: 41 ms After: 36 ms The benefit is around 9% and 12% respectively. Fixes: QTBUG-98874 Change-Id: I7d59ddc760168b15974e7720930f629fb34efa13 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QStringApiSymmetry: use QCOMPARE_EQ instead of QCOMPAREIvan Solovev2022-06-031-168/+168
| | | | | | | | | | | | | | | | | | | | This allows to defer the toString() invocation until it is really needed, and so allows to speed-up the test execution. I was testing a release shared developer build, running tst_QStringApiSymmetry 10 times before the change, and 10 times after the change, and then taking the average execution duration, as reported in the log. Before the change (using QCOMPARE): 51ms After the change (using QCOMPARE_EQ): 45ms As we see from the results, the benefit is around 10%. Task-number: QTBUG-98873 Task-number: QTBUG-98874 Change-Id: Ifcfbcca1f2c1eaf82c7f1a9098fa1512a269cbf8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE}_WITH_TIMEOUT()Ivan Solovev2022-06-037-7/+191
| | | | | | | | | | | | [ChangeLog][QTestLib] Add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE}_WITH_TIMEOUT macros that repeatedly execute QCOMPARE_{EQ,NE,LT,LE,GT,GE} until either the comparison returns true or the timeout expires. Also add QTRY_COMPARE_{EQ,NE,LT,LE,GT,GE} macros that simply invoke the *_WITH_TIMEOUT versions with the usual timeout of five seconds. Task-number: QTBUG-98873 Change-Id: Ib0d7d1c8c997f442b46acd85da738a8f512cc875 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}()Ivan Solovev2022-06-0310-1/+3985
| | | | | | | | | | | | | | | | | | | | | [ChangeLog][QTestLib] Add QCOMPARE_{EQ,NE,LT,LE,GT,GE}() macros. These new macros behave similarly to QVERIFY(a op b), where 'op' is ==, !=, <, <=, >, >= respectively, but print a formatted error message with argument values in case of failure. The formatting is done lazily, which means that the strings will be generated only when the comparison fails. Also add a new test for tst_selftest and generate expected output for it. Fixes: QTBUG-98873 Task-number: QTBUG-98874 Change-Id: Ic8074798901d7a469b1f58d5cd28bbf49a3da1db Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QUrlQuery: improve formatting of lists of pairs of stringsEdward Welbourne2022-06-031-30/+18
| | | | | | | | | | | | | | | | | | The compare() implementation made its actual and expected seem to have different types (using a typedef name for one, when the other was of the type that expands to) and the formatter it used was needlessly clunky. Use modern string literals and package a repeated null-or-quoted representation as a lambda, inline the resulting simplified prettyElement() into prettyPair(), which can now just take a pair rather than an iterator. Short-cut the empty list so that the comma-joined accumulation could initialize with the first entry and loop over the rest, always joining with a comma. Undo commit f776595cc10aaafc7162f382a8fa11afffb0e708's mistaken update to the copyright header and update correctly. Change-Id: I99258dafa01e79f9ec384d9b375a59376eb7fb53 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Endian: Allow special bitfield union fields to cover the whole storageUlf Hermann2022-06-021-1/+11
| | | | | | | | This requires a different computation of the mask since we can't shift out of the storage type. Change-Id: Ife85ca3e0c5ca47f06988a397cc2f8a7e28ad0fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Short live qxp::function_ref!Marc Mutz2022-06-024-0/+243
| | | | | | | | | | | | | | | This is an implementation of function_ref, which has been proposed for inclusion into C++23, but has not been accepted, yet, which is why we place it in namespace qxp (for eXPerimental) instead of q23. The implementation is based on wg21.link/P0792r9, which, at the time of writing, is the latest revision of the paper. It will be used in both QTestLib and qmldom. Fixes: QTBUG-103739 Change-Id: I52723eca28f7ac02ce7ce51928361d81ae5c92b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Do metadata detach simpler than full detachAllan Sandfeld Jensen2022-06-011-0/+20
| | | | | | | | | Avoid a full data detach when only metadata changes. This paradigm was already used one place, and made generic. Fixes: QTBUG-81674 Change-Id: I605253babc6ad9fc130e19e8cef3812690933ac5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add new map methods for QColorTransformAllan Sandfeld Jensen2022-05-311-0/+93
| | | | | Change-Id: I520fc4f4bd958472c6d6359bf671835796c677fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Test prepared qcolortransformAllan Sandfeld Jensen2022-05-312-17/+90
| | | | | | | | | | Add test of explicitly prepared qcolortransform, this is a state a transform can get into if used for an image transform. Also cleans up the test code. Change-Id: I9445ed114bed0edc790e14024aaae6a42989220b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add painter render hint for brush pattern transformationEirik Aavitsland2022-05-313-9/+105
| | | | | | | | | | | | | | [ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns would always be transformed along with the object being painted. In Qt 6.0 onwards, they would or would not, depending on the SmoothPixmapTransformation render hint. Instead of this somewhat surprising behavior, make the default be untransformed (i.e. cosmetic), which makes sense when it comes to dpr scaling. For the cases where one wants scaling, a new render hint is introduced to enable that: NonCosmeticPatternBrushes. Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Long live QAtomicScopedValueRollback (private API)!Marc Mutz2022-05-315-3/+169
| | | | | | | | | | | | | | | | | | | | | | | | | QScopedValueRollback has a few users that apply it on QAtomicInt, which happens to work as QAtomicInt is copy-constructible and its ctors are implicit. But that's of course nonsense. We don't need to store the oldValue in an atomic, nor do we need to pass the new value into the ctor as an atomic. So, add a QAtomicScopedValueRollback which works on std::atomic as well as the Qt atomics, but distinguishes between the reference (which is atomic) and the value (which isn't), and use it in one of the users, tst_QList. Keep it private until we know whether there's an actual need for this. The test is a copy of tst_qscopedvaluefallback, so the occasional oddity (like atomic op*=) should be ignored. Task-number: QTBUG-103835 Change-Id: I3c05b3e51f465698657a02ca5521ed465386e9a6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qglobal.h: use the GCC attribute for nothrow in C modeThiago Macieira2022-05-271-1/+2
| | | | | | | There's exactly one use in Qt: the qVersion() function. Change-Id: Ieb9a2aa1ea914b1b956bfffd16eff4b3b9e2119a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add compile-time generation of JNI class namesVolker Hilsheimer2022-05-273-4/+32
| | | | | | | | | | | | | | | | | | | | | As with method signatures, register class names using template function specialization in the QtJniTypes namespace, and then declare C++ types as JNI classes with a class name string. Such classes implicitly get registered as JNI types as well. Add a QJniObject construct method (since C++ constructors that are templates cannot be explicitly instantiated with a type), and a QJniEnvironment::findClass overload. Add test coverage, also for the recently added macros for native methods. As a drive-by, change the name of the Q_JNI_DECLARE_NATIVE_METHOD macro to Q_DECLARE_JNI_NATIVE_METHOD for consistency. Change-Id: Ic19562d78da726f202b3bdf4e9354e8ad24d8bd9 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QTextDocument: add setLayoutEnabled()David Faure2022-05-262-0/+40
| | | | | | | | | | | | This allows to set up everything first - without paying for the layout calculation at every step - and only then trigger the layout once. Results: 0.065 msecs to create a QGraphicsTextItem with some text (layouted) 0.036 msecs to set everything up in a QGraphicsTextItem with 0 width Change-Id: I138bd1d58941d029bc0a36d2730216778f1fbd97 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Expand QColorTransformAllan Sandfeld Jensen2022-05-261-17/+31
| | | | | | | | | | Add comparison operators and an isIdentity() method to detect (1-1) transforms. [ChangeLog][QtGui] Added QColorTransform::isIdentity() method. Added QImage::colorTransformed() transitive method. Change-Id: I5fbcd14e75f2179e43e94e8c5f42cd0a5600790b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add test of QColorTransformAllan Sandfeld Jensen2022-05-263-0/+237
| | | | | | | | | Before it was only tested indirectly as part of the qcolorspace tests. This also fixes a rounding for maximum RGB64 values. Pick-to: 6.3 Change-Id: I6106e662c0f9d00c0b3a0c13213cb051ea39e14e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QStringConverter: Do not crash if invalidFabian Kosmale2022-05-251-0/+56
| | | | | | | | | | | Attempting to use an invalid QStringConverter would so far have resulted in a crash, as we would dereference the null iface pointer. Fix this by inserting adequate checks, and ensure that hasError returns true if we attempt to en/decode with an invalid converter. Pick-to: 6.2 6.3 Change-Id: Icf74bb88cd8c95685481cc0bd512da99b62f33e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QKeySequence: Add missing modifier namesLaszlo Papp2022-05-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that when someone is trying to use the following code: QKeySequence keySequence(Qt::Key_Shift); qDebug() << keySequence.toString(); This will print seemingly gibberish output. It is unicode in practice. For Qt::Key_Shift, this would be: "�_@\uDC20" The reason why this is happening is because we have platform-specific ways to handle this due to Mac glyphs which are not available on Linux or Windows. This works fine on Mac. But for the Linux and Windows codepaths, there is not really any mapping like for other keys. It seems that modifiers were left out. The solution is to simply amend the list of mapping from these modifier key codes to raw strings for Linux and Windows like it is done for other key codes. So, now, modifiers will also be included in the list. So, the expected output will be generated for the above code, as: "Shift". [ChangeLog][QtGui][QKeySequence] Added missing modifier names Fixes: QTBUG-69715 Fixes: QTBUG-40030 Change-Id: I460d54bc8e593b350ff95894f23c5b4a7c819a44 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qpainter: change the FP exception block-list to a pass-listThiago Macieira2022-05-241-1/+8
| | | | | | | | | | | | | | | | We should prefer to test this unless we know it won't work, but this is very hardware and implementation-dependent anyway. So I declare that we'll only guarantee FP exception cleanliness on a best-effort basis for a few platforms. The notable difference in this commit is the removal of QNX. I don't know why it began producing an FP exception with one of my changes, but since the toolchain isn't public, I can't debug and will not devote any time to figuring it out. If users of QNX require this, then someone with interest in that OS will need to spend time after my changes integrate. Change-Id: Ibcde9b9795ad42ac9978fffd16f1cb9c03a0ff66 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_qtextboundaryfinder: Remove full copies of data filesIevgenii Meshcheriakov2022-05-243-9541/+0
| | | | | | | | | | There are no commented out test cases remaining, so the normal test vectors are identical to full test vectors. Fixes: QTBUG-97537 Pick-to: 6.3 Change-Id: I987f178f192e1c8e2d998d36499fdce84f237e77 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix line breaking before open parenthesesIevgenii Meshcheriakov2022-05-241-24/+24
| | | | | | | | | | | | | | UAX #14, revision 45 (Unicode 13) has changed rule LB30 to only trigger if the open parentheses is non-wide: (AL | HL | NU) × [OP-[\p{ea=F}\p{ea=W}\p{ea=H}]] This fixes the remaining 24 line break tests. Task-number: QTBUG-97537 Pick-to: 6.3 Change-Id: I9870588c04bf0f6ae0a98289739bef8490f67f69 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix line breaking for potential emojisIevgenii Meshcheriakov2022-05-241-1/+1
| | | | | | | | | | | | | | Implement part of LB30b introduced by UAX #14, revision 47 (Unicode 14.0.0): [\p{Extended_Pictographic}&\p{Cn}] × EM This fixes one line breaking test. Task-number: QTBUG-97537 Pick-to: 6.3 Change-Id: I3fd2372a057b7391d8846e9c146f69a54686ea61 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix interactions of WB3d and WB4 rulesIevgenii Meshcheriakov2022-05-241-1/+1
| | | | | | | | | | | Word breaking rule WB3d should not be affected by WB4. This fixes the remaining word break test. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I99aee831d7c54fafcd2a9d526a3e078b12c5bfad Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Handle WB3c word break ruleIevgenii Meshcheriakov2022-05-241-9/+9
| | | | | | | | | | | | | | | Adjust handling of WB3c rule to UAX #29, revision 33 (Unicode 11.0.0). The rule reads: ZWJ × \p{Extended_Pictographic} This fixes 9 word break tests. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I818d4048828e6663d5c090aa372d83f5099fdffe Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Adjust properties of WSegSpace word break classIevgenii Meshcheriakov2022-05-242-37/+37
| | | | | | | | | | | | | | | | | | Disable break between sequences of WSegSpace characters (rule WB3d, introduced in UAX #29, version 33, Unicode 11.0.0). Also disable breaks between WSegSpace and (Extend | Format | ZWJ) due to rule WB4. Adjust "words4" test to take the above changes into account (space character belongs to WSegSpace). Mention the full class name in a comment inside the word break table. This fixes 34 word break tests. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I7dfe8367e45c86913bb7d7fe2adb053711978487 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix handling of LB22 line break ruleIevgenii Meshcheriakov2022-05-241-28/+28
| | | | | | | | | | | | | | This rule was simplified in version UTS #14 version 45 (Unicode 13.0.0) to read: × IN Re-enabled 28 fixed line break tests. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I1c5565a8c1633428c22379917215d4e424ff0055 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix handling of ZWJ for line breaksIevgenii Meshcheriakov2022-05-241-9/+9
| | | | | | | | | | | | | | | Adjust implementation of rule LB8a of UAX #14. The rule was changed in version 41 (corresponding to Unicode 11.0.0): ZWJ × (ID | EB | EM) ⇒ ZWJ × Fixing this rule fixes 9 line break tests. Those are re-enabled. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I1570719590a46ae28c98ed7d5053e72b12915db7 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>