Commit Graph

47615 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
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
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
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
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
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
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
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
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
Timothée Keller 0e528f2976 Windeployqt: Fix -v/--version option
While the version option was already there, it had no output attached
to it, and simply generated the whole help text. Make sure that if the
-v/--version option is set, only the tool version is outputted.

Fixes: QTBUG-119511
Pick-to: 6.6
Change-Id: I59ee620333c02eb0a031cd05ac3170216cd034fa
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-28 19:59:48 +01:00
Wladimir Leuschner 5aff671eea Fix signed integer overflow in handling WM_SIZE message
The width and height of WM_SIZE parameters in LPARAM are unsigned ints,
but were extracted as signed ints with GET_X_LPARAM and GET_Y_LPARAM,
leading to signed integer overflow when using big window sizes.
The width and height are now extracted with LOWORD and HIWORD.

Fixes: QTBUG-119424
Pick-to: 6.6
Change-Id: Ie68716a08a686739b6464ce76319dc659fede336
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2023-11-28 18:59:48 +00:00
Eirik Aavitsland 7706c2a28e Raster painting: Correct the coordinate rounding in drawPoints()
When using the cosmetic stroker (i.e. plain pens with effective line
width of 1), drawing points with fractional coordinates >= 0.5 would
fill the wrong pixel.

This is a long-standing bug where the drawPoints() code in the
cosmetic stroker code was missed during the painting coordinate system
shift for Qt 5.0. Prior to that, coordinates were interpreted as the
upper left corner of a pixel, so rounding fractional coordinates to
the closest integer would be the correct way to determine the pixel to
be filled. From Qt 5 onwards however, coordinates instead designate
the center point of the primitive to be stroked. In order to determine
which pixel is most covered by the unit square centered in the given
coordinates, fractional coordinates must be rounded downwards
(floored).

This fix makes the behavior consistent between the cosmetic and
non-cosmetic stroker, so that drawPoints() with e.g. penwidths 1 and
1.01 in practice fills the same pixels.

Pick-to: 6.6
Fixes: QTBUG-119306
Change-Id: I39cb7ad55229553dda098e6fbc9ee449b1fd9664
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-11-28 19:47:56 +01:00
Inkamari Harjula c39844c78e Doc: Modify unreadable tables
Added breaks in List of Stylable Widgets table.
Changed List of Properties table into sections.
Added list of Qt-specific properties in beg of List of Properties chapter.
Moved snippet comments to different rows.

Task-number: QTBUG-118446
Pick-to: 6.6
Change-Id: I494401058c7982c0a0ada18c8c94429beabba348
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
2023-11-28 17:15:45 +02:00
Assam Boudjelthia 523cf06628 Android: rectify the visibility of QtAndroid.jar class
Since we expect soon to support embedding of Qt from native
Android apps, and allowing native apps to access some Qt java
classes as API to enbale the embedding, it's needed now to
set the visibility to public only to classes that are meant
to be public.

Task-number: QTBUG-115017
Change-Id: Iec73f8d39bf9c5f7d303176b2b345d5928fb46c7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia a419d4fbf0 Android: unregister display manager on onPause or onStop
Unregister the display manager listener onPause or onStop
and register again when onResume is called.

Task-number: QTBUG-118077
Change-Id: Ic48defda019fb132ef22a8229c4b549b0414b100
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 576be5d047 Android: don't pass Activity to some QtDisplayManager methods
Since the display manager is mainly created by the Activity delegate
and lives with it, so pass the Actitivy and use it internally,
instead of passing it to every method.

Task-number: QTBUG-118077
Change-Id: I7761490ac8746cc6dad3bd59514a54da18519990
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 43102fb55f Android: start native app from QtActivityDelegate instead of QtLayout
Starting the native application is not the responsibility of QtLayout
instead it makes more sense to be done under QtActivityDelegate so
move that logic there and avoid keeping its runnable inside the
QtLayout.

Task-number: QTBUG-118077
Change-Id: I4869cb5aa741289ed0e9ccaa1cf2ae42c9dd4791
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 8ddb27a11d Android: restore SystemUiVisibility state
System UI visibility is saved under onSaveInstanceState()
but never restored under onRestoreInstanceState().

Task-number: QTBUG-118077
Change-Id: Ic9956a4aca9e0b9bb5fefa37d7229dd0d52c7344
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:57 +02:00
Assam Boudjelthia 57330a18ca Android: rename isPluginRunning to isNativePluginIntegrationReady
This has been used to notify that the platform integration is
setup and ready, now the name is more descriptive of what it does.

Task-number: QTBUG-118077
Change-Id: I9fab525f07433f9ec8057e2475a3b1e4658f84d9
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:56 +02:00
Assam Boudjelthia aea816b197 Android: rework app state tracking
Cleanup 'isStarted' and state management logic and move it
to QtNative. Currently, it's spread between QtActivityDelegate and
QtNative where multiple variables are used for overlapping use
cases.

Task-number: QTBUG-118077
Change-Id: I2c98b48be78809c30636bfdf6d6640317470cec6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-28 14:37:56 +02:00
Ievgenii Meshcheriakov 86cfafcb5a qdbuscpp2xml: Register QtDBus metatypes
Explicitly register QtDBus-specific metatypes before attempting
to generate output. This fixes a bug when types like QDBusObjectPath
are sometimes ignored by this tool. Export QDBusMetaTypeId::init()
for that reason. Add a regression test to tst_qdbuscpp2xml.

Fixes: QTBUG-34550
Change-Id: I16faa79a794d09a26bad45e18730379681a20b50
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-28 13:37:56 +01:00
Thiago Macieira b2d24044c2 QFactoryLoader: use the new UTF-8 QCborStreamReader API for performance
That way we don't need to decode to QString in order to compare to
"Keys". There's no avoiding the conversion to it when inserting in the
map for top-level elements, but use of moc's -M option is extremely
rare.

Ideally, we'd simply ask QCborStreamReader to perform a comparison to a
string of ours, so we didn't have to memcpy from the stream in the first
place. But TinyCBOR has no API for that (it's been pending as
https://github.com/intel/tinycbor/issues/223 for a while).

Change-Id: I8bd6bb457b9c42218247fffd1797607f75b153f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-28 03:14:03 -08:00
Thiago Macieira 878e3342e1 QFactoryLoader: add metaDataKeys() to return just the "Keys" entry
Without parsing the whole metadata structure into a QCborValue.

QFactoryLoader::indexOf() is only used in the icon engine and
accessibility loaders. QFactoryLoader::keyMap() has more users, but
QFactoryLoader::metaData() is still by far the most used interface.

Task-number: QTBUG-114253
Change-Id: I8bd6bb457b9c42218247fffd179753524fc9b6a5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-28 03:14:03 -08:00