Commit Graph

64638 Commits (e11cbf206fdbc018bb475bca495c182a7a91e652)

Author SHA1 Message Date
Kai Köhne e11cbf206f Doc: Change deprecation of QFuture::makeReadyFuture to 6.6
The compilers will only warn about using makeValueFuture from
Qt 6.10 onwards. Anyhow, for the documentation, it makes more
sense to deprecate it right now, as an alternative API is
available. So deprecate in documentation for Qt 6.6, but
mention that the compiler warning will only be shown in Qt
6.10.

While at it, also make sure the deprecation messages are
proper sentences (end with a dot).

Pick-to: 6.6
Fixes: QTBUG-116898
Change-Id: Iff90441372b788f9ea42634866d97068275bf0ca
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-12-04 15:04:04 +02:00
Alexandru Croitor ffa79f5e0c CMake: Don't run sdk / xcode version checks on non-Apple platforms
It was an oversight.

Amends a29bff3d80

Pick-to: 6.6
Change-Id: I696d7a2650c336dc93df01245065bcbb61ca1d6b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-12-04 13:11:49 +01:00
Eskil Abrahamsen Blomfeldt 7bc6f4ae8e Support arbitrary variable axis values
This adds API to set arbitrary values for axes in variable
fonts to QFont.

It also implements support for the API in CoreText, FreeType
(on all platforms) and DirectWrite.

Note that in order for the mechanism to work with
application fonts on DirectWrite, we need to keep the loader
for the fonts around for the life time of the font (otherwise
they cannot be reloaded with different parameters). The way
this was handled before (just re-creating and throwing away
the loader every time) was not ideal anyway, and this finally
gives us a good reason to fix it.

Fixes: QTBUG-119421
Fixes: QTBUG-117835
Fixes: QTBUG-117838
Fixes: QTBUG-117839
Change-Id: I3d1fe95fba1f9df52f34aa42e1ac5fa47dbe6d1a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-12-04 11:17:36 +01:00
Friedemann Kleint 5134b3ad54 EditableTreeModel: Polish TreeModel::setupModelData()
- Use QStringView.
- Use a list of a pair-like struct to represent the state instead of
  2 lists.
- Use qsizetype.
- Use constLast() to avoid detaching.

Pick-to: 6.6
Change-Id: I5ff8a17a4d583a7d2a0a11a52c29b9117280382c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-12-04 10:55:01 +01:00
Friedemann Kleint d9c71b834c SimpleTreeModel: Add a test
Add a test running QAbstractItemModelTester on the model.

Pick-to: 6.6
Change-Id: I6ea5d34308357409b9a13eb0271392c8d171addd
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-12-04 07:38:56 +01:00
Tor Arne Vestbø 9590ed6ba6 macOS: Implement QPlatformServiceColorPicker via NSColorSampler
The default behavior for QColorDialog is to use the native dialog,
but for clients that implement their own color dialog we should
provide the plumbing to do the actual color picking. The fallback
path for this on macOS involves grabbing the screen, which brings
up the permission dialog. The NSColorSampler API does not have this
issue.

[ChangeLog][macOS] Non native color dialogs now use native color
picking when picking colors from the screen.

Pick-to: 6.6
Change-Id: Idd08a90a3747546fd9825431ab7a4f5b5fa40784
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2023-12-02 11:21:59 +01:00
Jaishree Vyas 1202594db6 Doc: PainterPaths-Graphic&Multimedia-Example typo in the documentation
Changed the brief and some grammatical errors.

Fixes: QTBUG-119602
Pick-to: 6.6
Change-Id: Ib64abeb735899b0ae1cee64709ad3d7f8f440d9e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-12-01 20:56:10 +01:00
Wladimir Leuschner 3e50387f82 Fix documentation for qDrawPlainRoundedRect
Change-Id: Ifc7b8fe1d7dda10d29b5c50ebd7bc5c352c9c0c2
Reviewed-by: David Faure <david.faure@kdab.com>
2023-12-01 16:02:53 +01:00
Thiago Macieira 7bf1989e62 Remove the DBusMessage* members from QDBusMessagePrivate
We don't need to keep the entire original message in QDBusMessagePrivate
after we've demarshalled it, nor do we need to keep a link to the
message we're replying to. In order to reply properly to a message, we
only need two pieces of information: the serial of the method call being
replied to and the service that originated the call.

Fixes: QTBUG-69919
Change-Id: Ic5d393bfd36e48a193fcffff13b7375db459e619
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-12-01 14:06:03 +01:00
Topi Reinio 24627d9bce Doc: Add convenience macros for specifying C++ type ordering information
QDoc in Qt 6.7 introduced new commands for C++ type ordering, \compares
and \compareswith .. \endcompareswith. The latter is a block command
that allows defining a comparison category, a list of types the
category applies to, and optional further information inside the
command block.

Introduce convenience macros that allow a single-word/single-line
command to provide the category/types in cases where further information
can be omitted.

Task-number: QTBUG-104110
Change-Id: I850498c79bd6885906fbc58d0517d33f5a13cf4b
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-12-01 11:58:36 +00:00
Joni Poikelin 402a17cfc8 Silence a warning in release build
Pick-to: 6.6 6.5
Change-Id: I6059b560872ebd97874c2dc80e3ad17cf887d8dc
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-12-01 13:22:00 +02:00
Joni Poikelin cc40039b4f Add Q_OBJECT_NO_OVERRIDE_WARNING for MSVC
Change-Id: I5fc19c03eae3b7ea1aab83c5e3c978d57970bd25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-12-01 13:22:00 +02:00
Andreas Eliasson 0201d5e232 Doc: Match descriptive text with code snippet
The code snippet reads QDataStream::Qt_6_5. Change the post-descriptive
text to match this.

Fixes: QTBUG-118907
Pick-to: 6.6 6.5
Change-Id: I3b3d03e9095a6ba6febfb652b3bc7173ed4ccfa4
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-12-01 10:42:41 +01:00
Mitch Curtis f60fb8f417 Avoid segfault in QWindow::mapFromGlobal when platformWindow is null
If the window hasn't been shown yet (as is the case when running
./tst_qquickmaterialstyle Material::test_background:drawer in
qtdeclarative), platformWindow can be null. Check for that and use
the pre-67fa2585ac48e64972d1c0a20b3add5c3ef72e51 code path instead.

Fixes: QTBUG-119517
Change-Id: I8333578b94f91b5a2994875da6dc568a360d2edf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-01 12:42:13 +08:00
Marc Mutz f96a17225f Rename EINTR_LOOP -> QT_EINTR_LOOP
This non-namespaced macro was defined in a header, and while that
header is private, we shouldn't define non-namespaced macros in our
headers.

The macro also clashed with one of the same name defined in forkfd.c,
which broke unity-builds including the forkfd_qt.cpp TU. This rename
fixes that, too, so we can now remove forkfd_qt.cpp from
NO_UNITY_BUILD_SOURCES.

Pick-to: 6.6 6.5
Change-Id: Ic4bb4e4d7a632ca87905e48913db788a7c202314
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-30 22:52:11 +01:00
Assam Boudjelthia a2309116a8 Android: fix mis-use of AccessibilityNodeInfo.addAction()
The commit 41765ef3e2 tried to
fix a deprecation warning by using the wrong API replacement,
this fixes that. Check the Android docs for the replacement API.

https://developer.android.com/reference/android/view/accessibility/
AccessibilityNodeInfo#addAction(int)

Task-number: QTBUG-118077
Change-Id: I2621d47fa4425cc1056fc995ea458a798160a6a0
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 8c167c62ca Android: fix usage of deprecated android.text.ClipboardManager
android.content.ClipboardManager is the replacement for the
deprecated android.text.ClipboardManager API.

Task-number: QTBUG-118077
Change-Id: I14038ee4b21150d8bcb9f5bfeb82369347d7f215
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 3e35db6997 Android: guard against null objects
And minor warning fixes for unused imports.

Task-number: QTBUG-118077
Change-Id: I8296ae019da9d40692687e49ac926f96af901870
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 5c15990534 Android: fix exception with non-existent default QtClipboardManager ctor
Don't call a non-existent default constructor for QtClipboardManager.
That throws the exception:

 java.lang.NoSuchMethodError: no non-static method "Lorg/qtproject/qt/
android/QtClipboardManager;.<init>()V"

Task-number: QTBUG-118077
Change-Id: I75d89446706895140ef54ccc2162436c55ef49b7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 6a7f9d6b14 AndroidTestRunner: use Qt::StringLiterals and some cosmetic changes
Cleanup the includes, and remove unused include dir in CMakeLists.txt.

Task-number: QTQAINFRA-5928
Change-Id: I477024291042042765b666bda882bab4a5f8313f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:27 +02:00
Assam Boudjelthia 10a706df27 AndroidTestRunner: use QProcess instead of popen()
Using QProcess would make the test runner more robust when dealing
with quoted arguments since it won't be using the system shell and
handles quoting under the hood.

Fixes: QTBUG-105524
Fixes: QTQAINFRA-5703
Change-Id: Ib666ffea33302f1dfc7e8972bd7750f14065c4fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:26 +02:00
Assam Boudjelthia ee874e7ca8 Android: accept both spaces and tabs separators for env vars and args
The requirement for separating the app args by tabs only is not
justified, since the the args are passed as a string to C++ where
QProcess::splitCommand() is used to get a list of single args and
that knows how to handle the parsing properly anyway.

As for env vars, QtLoader currently expects env vars to be separated
by tabs only, however, to account for different use cases, it should
handle both tabs and spaces.

Task-number: QTBUG-115016
Task-number: QTBUG-106478
Task-number: QTQAINFRA-5703
Change-Id: I58258861477776b82294a4c2603b230f178f16a6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-30 17:26:26 +02:00
Assam Boudjelthia b044323c16 AndroidTestRunner: Fix treatement of quotes in test args
This has two parts, under testrunner, make sure to pass test args
that has quotes as \\\" so that the Android app gets a \" after parsing
the intent extras. The app args are then is passed to C++ where
QProcess::splitCommand() is used to parse the args string into a list,
and to preserve the quotes in this case, the former call expects triple
quotes to to get the quote character preserved in the split list.

Fixes: QTQAINFRA-5703
Change-Id: Iad81cadf24a6def21ef1536c882ecd510c4426cf
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:26 +02:00
Alexandru Croitor d2c29aee41 CMake: Compute dynamic timeout for androidtestrunner
Pass a CMake test TIMEOUT argument to androidtestrunner, using
a value of 95% of that timeout to allow time for the test runner
to do any cleanup before being killed.

If no test argument is provided, use the value from CMake property
DART_TESTING_TIMEOUT or CTEST_TEST_TIMEOUT. If that's not provided
default to 25 minutes which is the default for DART_TESTING_TIMEOUT.

Along the way set the default androidtestrunner timeout to 10 minutes
and fix the wrong timeout in the help menu.

Fixes: QTBUG-106479
Pick-to: 6.6 6.5
Change-Id: I12cd531583dd94954caf8044c37c22382d53d43c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:26 +02:00
Assam Boudjelthia 0d5fe9c3d7 AndroidTestRunner: pass testlib env vars to the test app
Check if the common testlib environment variables are set on the
host and pass them to the test app. This include any env variable
starting with "QTEST_".

Fixes: QTBUG-106478
Task-number: QTBUG-106479
Pick-to: 6.6 6.5
Change-Id: I99e1b314b106cda20a66e3cac9a92b463b94f5c9
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-30 17:26:26 +02:00
Assam Boudjelthia 20643d17bf AndroidTestRunner: fix failure to acquire test runner semaphore
Currently, if the test runner is interrupted by SIGINT and SIGTERM,
the semaphore is never released and thus consecutive test runner
executions will wait forever. To fix that, a signal handler for the
former signals is added to release the QSystemSemaphore. Also,
remove RunnerLocker and simply use QSystemSemaphore directly,
and explicitly release the semaphore at the end of the test runner
execution.

Fixes: QTBUG-115298
Pick-to: 6.6 6.5
Change-Id: I4f6cc0e4d837460de9a66248e09d3cbaf24ce959
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
2023-11-30 17:26:26 +02:00
Jacek Poplawski 05e5d18393 Add VxWorks support in QEglFSDeviceIntegration
Fixes: QTBUG-115777
Change-Id: Ic2f860c259e42b3d4670fe85b3a069c84be5c1da
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Reviewed-by: Jarno Lämsä <jarno.lamsa@qt.io>
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
2023-11-30 16:26:26 +01:00
Luca Di Sera 60c2d72d96 Doc: Fix \fn template arguments for Qt Core
Upcoming changes to QDoc require accurate definition for
template arguments in \fn commands.

Task-number: QTBUG-118080
Change-Id: I64d50919bc6ffab61ef5ead553d1da99d63a9f21
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-30 11:26:20 +01:00
Rami Potinkara 7b84cd62b0 Android: bump Android target API level to 34
Bumped on network related .gradle files too.

Fixes: QTBUG-119145
Change-Id: I95f70e6cda1aad7a6bd7246c623eb6f143a829cb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-30 08:57:55 +02:00
Kai Köhne 321718af88 Doc: Fix wrong markup in QStandardPaths::findExecutable
Pick-to: 6.6
Change-Id: Ia9b9752a7d73b8695f2be227d7fe78e6da927a2e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-11-29 18:20:06 +01:00
Marcin Zdunek 8e97af265d Disable timezone which is not supported on Vxworks
Task-number: QTBUG-115777
Change-Id: I69bf26d2e752d76d06edf569766d4298fb4fd1a8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-29 16:08:56 +00:00
Edward Welbourne 4366487e79 Change POSIX current time query to use clock_gettime()
As noted on its man-page, POSIX.1-2008 marks gettimeofday() as
obsolete, recommending the use of clock_gettime(2) instead. So do
that. Also check the return value - albeit all we can do on failure
(which should not happen) is assert.

Pick-to: 6.6 6.5
Change-Id: Id5d6922c974b87f09531d549d692b051c32388ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-29 16:24:05 +01:00
Alexandru Croitor 4cb9bbbf02 CMake: Remove noisy and non-informative message
Amends ac6af2f322

Change-Id: I85b87d3200e556853af6c1da2ae12961fb126614
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-29 16:00:57 +01:00
Alexandru Croitor a29bff3d80 CMake: Warn when configuring Qt with an unsupported Apple SDK or Xcode
The warnings are shown when configuring any Qt submodule or top-level.
The warnings are NOT shown when configuring a user project with CMake.

Opt out CMake cache variables can be set to silence any of the
warnings:
- QT_NO_APPLE_SDK_AND_XCODE_CHECK
- QT_NO_APPLE_SDK_MIN_VERSION_CHECK
- QT_NO_XCODE_MIN_VERSION_CHECK
- QT_NO_APPLE_SDK_MAX_VERSION_CHECK

The warnings can be upgraded into errors by configuring with
-DQT_FORCE_FATAL_APPLE_SDK_AND_XCODE_CHECK=ON

The platform version requirements that qtbase specifies in .cmake.conf
are saved in Qt6ConfigExtras.cmake so that they can be used when
configuring other non-qtbase submodules.

The code is added to the public CMake files, so that in the future we
don't need to move code around if we enable the checks for public
CMake projects as well.

The version extraction helpers were moved out of QtAutoDetectHelpers
into QtPublicAppleHelpers.

Task-number: QTBUG-119490
Change-Id: Ic840e1013aeb607bf23247a9cb43471dde802e9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-11-29 16:00:57 +01:00
Alexandru Croitor ba9d45088f CMake: Move QtAutoDetect.cmake functions into a separate Helpers file
And automatically include and install it in all qt builds.
We will use some of its functions for enforcing apple sdk
requirements when building Qt.

Change-Id: I46383bc857430d35314dfa2ebef9eb342fb63560
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-11-29 16:00:57 +01:00
Alexandru Croitor 830c4041be CMake: Create wrapper scripts after global feature evaluation
Otherwise we don't have access to the 'debug' and 'debug_and_release'
features to decide whether the install script needs to strip binaries
or not.

Amends 09fdddeb32

Pick-to: 6.6
Fixes: QTBUG-118070
Change-Id: I4f1b8463fa369edd38c1110d1d69e7fa7a45de63
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-11-29 16:00:57 +01:00
Alexandru Croitor 832eda3beb CMake: Remove deprecated PUBLIC_LIBRARIES option in wasm tests
Tests should only use the LIBRARIES option.

Pick-to: 6.5 6.6
Change-Id: I3c1e4a563448e8f97219c10566cea921a2807abc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-29 15:00:57 +00:00
Ievgenii Meshcheriakov 7169ea71bd QDBusAbstractAdaptor: Assert that the parent is not null
QDBusAbstractAdaptor is expected to be used with a parent.
Add an assertion that will fail if a user is using this
class incorrectly. That's easier to debug than a null
pointer dereference in QDBusAdaptorConnector::polish().

Fixes: QTBUG-18525
Change-Id: I1934475fe277e0cc08435d79f1d453d6576f0b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-29 15:53:13 +01:00
David Faure 5ef5f2f1b9 QCommonStyle: draw focus rect using qDrawPlainRect
A non-aliased drawRect(r.adjusted(0, 0, -1, -1)) no longer does the job
in Qt6: hi-dpi is now enabled automatically, which scales the painter
and leads to horrible (non symmetric) rendering.

I doubt any actual widget style calls into this code (which draws
a focus rect with a plain line) but it's still a useful example
and fallback when writing a widget style.

Pick-to: 6.6
Change-Id: Ib407a7355033258be568b4826fe01c110f02c018
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-11-29 08:58:46 +01:00
Ivan Solovev 7a3fed3f20 QTimeZone: use new comparison helper macros
The class had operator==() and operator!=() defined as public member
functions, so use QT_CORE_REMOVED_SINCE and removed_api.cpp to get
rid of these methods and replace them with hidden friends.

Extend unit-tests by using the helper functions from QTestPrivate.

Task-number: QTBUG-104111
Change-Id: Ib9ca613005e2f1521dea5e3cd9e2baa0b47fede4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-28 21:30:58 +01:00
Ivan Solovev 5839aed9bd QDateTime: use new comparison helper macros
The unit-tests were already ported to the new comparison helper
functions from QTestPrivate.

Task-number: QTBUG-104111
Change-Id: I95fccb33433b3bbf1167545e347a271140727f23
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-28 21:30:52 +01:00
Ivan Solovev ff04c24184 QTime: use new comparison helper macros
The unit-tests were already ported to the new comparison helper
functions from QTestPrivate.

Task-number: QTBUG-104111
Change-Id: I23267fd457547b2705e821e7666130f5f9c019d5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-28 21:30:46 +01:00
Ivan Solovev a6f4e55b4d QDate: use new comparison helper macros
Comparison with std::chrono types is also supported due to implicit
QDate constructors, which were made constexpr and noexcept in the
previous patch.

The unit-tests were already ported to the new comparison helper
functions from QTestPrivate.

Task-number: QTBUG-104111
Change-Id: Ib6b1122af9eaf2cb2c9db768150a31cf3bcadcc0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-28 21:30:40 +01:00
Ivan Solovev 96f494bf92 Implement helper Qt::compareThreeWay() function for built-in types
The helper function

 RetType compareThreeWay(const T &left, const T &right) noexcept;

is used for C++20-comparison macros. Normally it's the user's
responsibility to provide this function as a hidden friend of the class
which uses the comparison helper macros.
For built-in types we provide the implementation inside the Qt
namespace.

We have to use custom IsIntegralType trait because libstdc++ only
treats __{u}int128_t types as integral when compiling in -std=gnu++XX
mode, and we compile Qt in -std=c++XX mode.

This patch provides the implementations only for compareThreeWay()
overloads, because there is no need to implement comparesEqual() for
built-in types. It would just be equivalent to calling operator==(),
so the user can do it directly.

Task-number: QTBUG-104113
Change-Id: I7b3f395458e1ee4c64f442ad48bbf4fec4c19c52
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-11-28 21:30:33 +01:00
Ivan Solovev 5a28aacd85 Implement checking of op<=> in the compare test helpers
The operator<=> is only checked if it is implemented.

Task-number: QTBUG-104113
Change-Id: I89396ca5edea7db9e1f9b0459c277cb4268e1f48
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-11-28 21:30:26 +01:00
Ivan Solovev fe12650e9d Implement compare helper macros
These macros should unwrap into a proper set of equality and ordering
operators, depending on the C++ standard being used.
For C++17, all 6 operators (==, !=, <, >, <=, >=) are overloaded, while
for C++20 only the overloads for opeartor==() and operator<=>() are
provided.

The macros are documented as internal for now.

The macros rely on two helper functions:
  bool comparesEqual(LeftType lhs, RightType rhs);
  ReturnType compareThreeWay(LeftType lhs, RightType rhs);

The comparesEqual() helper function is used to implement operator==()
and operator!=().
The compareThreeWay() helper function is used to implement the four
relational operators in C++17, or operator<=>() in C++20.
ReturnType must be one of Qt::{partial,weak,strong}_ordering.
When possible, the functions should also be declared constexpr and
noexcept.
It's the user's responsibility to provide the functions before
using the macros.

Implement a test case which applies the new macros to the dummy
classes, and uses the new helper function to verify the comparison
results.

The MSVC compiler before version 19.36 has a bug, where it fails
to correctly generate reverse opeerators in C++20 mode. Introduce
a new Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY definition for such
compiler versions, and use it to manually generate reversed
operators when needed.

Task-number: QTBUG-104113
Change-Id: Idc19d55df011fd616ff654f35a964e831b8ab93b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-11-28 20:30:19 +00:00
Eskil Abrahamsen Blomfeldt e616f8decb Add missing detach when clearing font features
Same as when setting the features, we need to detach (but keep
the engine data) when clearing them.

Change-Id: I3adcadfb24c4abfff9c9e1c4f42ed4af919c71f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2023-11-28 20:58:34 +01:00
Edward Welbourne 5108192f67 Clean up QDate(Time)?::fromString() test-data tables, adding a column
The new column is currently unused, added for the benefit of an
imminent change, but adding its value was going to change every data
row, making the new rows with a different value there hard to see amid
the diff.

So add the unused value to the existing data rows and clean them up in
the process:
* Use modern string literals
* Split lines (that need it) in a consistent way
* Give test-cases not-entirely-meaningless names.

Change-Id: I9abdd24b7bb945796878c664d2ed82ca6c409fc1
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-28 19:59:49 +01:00
Sami Shalayel 26f0eaba52 do not override initial AUTOMOC_MACRO_NAMES value
The CMake documentation states that the AUTOMOC_MACRO_NAMES property of
a target is initially set to CMAKE_AUTOMOC_MACRO_NAMES, so do not
override it in qt_enable_autogen_tool.
Instead, append the extra macro names not set by the upstream CMake
CMAKE_AUTOMOC_MACRO_NAMES variable.

Add a test for this.

Change-Id: Ib0ef28e7fc9c5f9559150bbe73ffdeac767adc82
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-28 19:59:49 +01:00
Edward Welbourne 4f05ffeb41 Restore ASN.1 Element tests after move to plugin
When SSL backends were broken out as plugins, various tests were
suppressed since the code they test is now in a plugin, no longer part
of the network libraries.

The ASN.1 test is, however, fairly self-contained, so just compile it
with the relevant plugin sources (which are likewise self-contained)
and brute-force the paths to line up for the test.

Task-number: QTBUG-46843
Change-Id: I778489e68b7361a7fd55c88d2a35257ad6a58c46
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-11-28 19:59:49 +01:00