Commit Graph

56501 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
9e8adb6464 QAbstractItemView: check the index emitted by the delegate's sizeHintChanged
The index in question has to belong to the view's model. An erroneous
emission shouldn't be silently ignored.

Change-Id: I7e037e72affb210f609a9a1029777acafae041f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-28 03:53:28 +02:00
Samuel Mira
5fd6704091 Fix restart QtActivity
Previously, a restart of QtActivity on Android would make the
application fail with a blank screen. That happened because the
QtActivity tried to reload the whole application and failed.
With this patch, the QtActivity detects if the application is restarting
by checking if QtNative and QtActivityDelegate are live and updates the
connections on those objects accordingly. It allows the application to
continue as before. In case that is not possible, the QtActivity will
restart the application.

Fixes: QTBUG-38971
Fixes: QTBUG-102298
Pick-to: 5.15 6.2 6.3
Change-Id: Id500d20b185d57b39d45d34eeaa99745a3c2b95b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-27 19:55:33 +00:00
Mårten Nordheim
41d217829c QHttp: Fix handling of redirect loaded from cache
In some situations when loading a redirect from cache which would lead
to a real request we would not emit the finished() signal because the
replyFinished function has a pre-condition that the response did
not originate from the cache.
However, after the initial redirect was loaded from the cache we never
unset the 'loadingFromCache' boolean, so it was still true after the
request had been made to the real target.

Pick-to: 6.2 6.3 5.15
Change-Id: I015a2ebae4af4bd17392182c3951e875a7b353c4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-27 18:31:01 +02:00
Mårten Nordheim
d642c16fe7 QNetworkReply: update decompress error message and handling
The error message was quite vague since it would then not require
any additional translations. However, in hindsight this was a mistake
since now developers just thought their downloads were being corrupted.

Pick-to: 6.2 6.3
Fixes: QTBUG-101942
Change-Id: Ie9af42510ca027d15248e5bcf21e836e709898d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-27 18:31:01 +02:00
Giuseppe D'Angelo
45b09215e5 tst_qitemdelegate: make it more robust
Remove a processEvents() call followed by a QCOMPARE and turn it
into a QTRY_COMPARE. Otherwise it seems to be randomly failing on Ubuntu
22.04.

Change-Id: I3c1b9d55c857c79ffd36aeb98971db60267adace
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-27 17:54:19 +02:00
Edward Welbourne
0b5b98c4ae Fix qlocale_unix's handling of uiLanguages to take script into account
Some languages have, in the same territory, locales for more than one
script. In such cases, since we ignored the script, we got the one
that is used by default, instead of the one actually asked for. Take
the script into account.

Added TODO comment in test listing the known examples of this;
manually tested before and after the fix to verify the prior code was
indeed getting it wrong and now does do it right.

Change-Id: Iaf9201d6992bc39e6e9346ef8b7c69d418db7253
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-27 17:03:54 +02:00
Edward Welbourne
7a7f2547f3 Return more specific entries before less in QLocale::uiLanguages()
The documentation overtly listed entries in this order but the code
gave less specific entries before more specific (and the tests
verified the same). This is now reversed.

[ChangeLog][QtCore][QLocale] uiLanguages() now prefers more specific
locale names over less specific ones, matching its own documentation,
except where the system backend supplies them in some other order.
This means a translation with the expected script and/or territory as
well as language will be used in preference to a generic one for just
the language, rather than only as a fall-back when the more generic
one is missing.

Fixes: QTBUG-102796
Change-Id: I3c7b3627afb51246df5a6ad0230e23b60af78071
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-27 17:03:54 +02:00
Alexandru Croitor
bf96f0eea0 tests: Blacklist tst_QLocalSocket::threadedConnection on Windows
As well as processConnection.

These tests cause flaky failures on Windows.

Pick-to: 6.3
Task-number: QTBUG-102880
Change-Id: Ie4bfe2ef40ad44efcfd0d83711ce257d1244ecdc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-27 17:03:54 +02:00
Sona Kurazyan
c099ed5e3f QtXml: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

Change-Id: Ic3e2391dc104f9f4f580166ce4211040fbda7bb0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-27 16:08:14 +02:00
Laszlo Agocs
e8562b0e8d egl: Remove the disabling of surfaceless contexts for Mesa
The current check is based on the state of things in 2015,
we will assume that this is no longer an issue with more
modern Mesa versions.

Change-Id: I60c4966eea817a6df1a1edf6064a978fbcd44cf7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-27 06:13:13 -07:00
Laszlo Agocs
8161726619 Revive eglfs' raster window support
A number of consequences of the new rhi-based backingstore
composition were not handled. Most importantly, the fact
that RasterGLSurface is not a thing anymore in practice
causes challenges because we can no longer decide just
based on the surfaceType what a QWindow with OpenGLSurface
would be. (a plain GL window or a GL window with a backing
store?) Also, the backingstore needs to be able to initialize
its backing QRhi by itself, because with eglfs going through
OpenGL is the only way.

Amends 68a4c5da9a

Fixes: QTBUG-102750
Change-Id: Ia1ca59d01e3012264a76b50e591612fdcc2a0bd6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-27 06:13:13 -07:00
Laszlo Agocs
9861fd09cb eglfs_x11: Fix running flag linkage
Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-102821
Change-Id: I49db74c0d554bdf870a4521ab91d154b8a80c375
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-27 06:13:13 -07:00
Inho Lee
8f9049ddbc Update comments in QQuaternion::getEulerAngles
A comment from the patch 6ffc8d8eb6
is a little ambiguous. This patch is just to give information
about the modification.

Task-number: QTBUG-72103
Pick-to: 6.3 6.2 5.15
Change-Id: I6bfc3ae926c118de0d969a4b44f438c24f8d4f72
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-27 09:16:29 +02:00
Giuseppe D'Angelo
6625a4744e QAbstractItemView: warn in some erroneous conditions
If a user or a delegate asks a view to act on an editor that does
not belong to the view, report a warning instead of silently
ignoring the problem. This erroneous condition can happen for instance
if a user installs the same delegate on multiple views (something
that the documentation says _not_ to do) and the delegate indeed
emits signals related to the editors of one view -- the other views
don't know about that editor.

Change-Id: I2d10582ebb7aefca4acea306b8a57bcc3162050a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-27 05:34:29 +02:00
Thiago Macieira
f02879a97a QFutureInterface: insert x86 PAUSE in tight CMPXCHG loop
From the Intel Software Optimization Manual[1], Chapter 11 ("Multi-core
and Hyper-Threading Technology"), offers:

User/Source Coding Rule 14. (M impact, H generality) Insert the PAUSE
instruction in fast spin loops and keep the number of loop repetitions
to a minimum to improve overall system performance.

See section 11.4.2 for an explanation of why this is a good idea.

[1] https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html#inpage-nav-5

Pick-to: 6.3
Change-Id: I7fb65b80b7844c8d8f26fffd16e94088dad1ceee
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-04-26 19:38:12 -07:00
Mario Emmenlauer
f3640d9086 Fix for ClangCl missing F16C intrinsics in qfloat16.h
Done-with: Thiago Macieira <thiago.macieira@intel.com>
Fixes: QTBUG-101175
Change-Id: I46ef5c473f174e54a8cffffd16e5334d3b5944b8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-04-26 19:38:12 -07:00
Thiago Macieira
860b8d00ca Fix build with GCC 12's libstdc++ and Clang
qsimd.cpp:400:31: error: no member named 'size' in namespace 'std'

Pick-to: 6.2 6.3
Change-Id: I35544e2937c048e4a466fffd16e97e7a20d9da69
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-04-26 15:45:46 -07:00
Tor Arne Vestbø
aa0a53fc19 Don't declare type 'id' in the global namespace in a public header
It's not necessary, and it breaks the qttools build (where we have a
global variable named 'id'), and thus will most certainly build a lot
of existing user code.

Amends e47c22480f.

Change-Id: I97a91c2cb23fdae65143cf14c81570cf88d529d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-27 00:16:26 +02:00
Allan Sandfeld Jensen
c164b75c17 Pass compilers on to examples configs
Otherwise they will just use default compiler

Pick-to: 6.3
Change-Id: Id5813b99fbbb6b0d8b0ee658e06312b637a097c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-26 22:58:56 +02:00
Sona Kurazyan
c5e36ca85a uic: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: Ied042c0a61e48844694f6a94f0423735e92fb6d3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-04-26 21:59:07 +02:00
Sona Kurazyan
cd9cbc34db uic: replace QLatin1String uses with _L1 or _s
Task-number: QTBUG-98434
Change-Id: I5a9b01d1dd2a2a727cfb71e829dbf631bf25e2db
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 21:59:07 +02:00
Sona Kurazyan
07071e3c0c QtCore: remove the remaining uses of QLatin1String
Task-number: QTBUG-98434
Change-Id: Iba9194f525d983f735d3927a0dbfae6b9013c408
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-26 21:59:07 +02:00
Edward Welbourne
e1d50add35 Simplify QConfFileSettingsPrivate::readIniSection() using QBAV
It needs fewer moving parts this way. In the process, to match the
QString strValue, rename a QString key to strKey, freeing the name key
for a view.

Change-Id: Ic58145fd665db265d136545ced59e293a2eed1eb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 21:59:07 +02:00
Simeon Kuran
64af542374 Fix potential crash in QNetworkInformation if no network is available
In some circumstances, an empty QDBusInterface was created. However,
this can lead to a crash on some systems (observed in Ubuntu 20.04).
The crash happens, when no network is available.

Pick-to: 6.3
Change-Id: I37316db547f33f082b8aaa73494db1bdf5aded1d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 19:46:21 +02:00
Laszlo Agocs
464418f5de rhi: d3d11: fail early with a broken device
Broken meaning not being functional with shader model 5.

This can happen with certain virtual machines where there is an
accelerated DXGI adapter which then only supports a feature level
lower than 11_0, and so SM 5.0 shaders do not work. Similarly, GPUs
from 2009 and earlier may have a similar driver setup.

We do not particularly care about such devices, however we should make
sure it can be recognized early on (i.e. in create()) that something is
not right and fail the entire QRhi initialization. Otherwise no error
will occur until attempting to create the first shader via a
QRhiGraphicsPipeline and that's way too late.

This way clients such as Qt Quick can make an effort to retry with some
other settings, most notably the PreferSoftwareRenderer flag, in order
to pick the sw rasterizer based adapter (WARP).

Task-number: QTBUG-78648
Change-Id: Ia4a3a0bc1a09e2864d426d4d55978dc6f759127c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-26 19:46:21 +02:00
Laszlo Agocs
b78f3f4974 rhi: Make QRhiRenderTarget's rp getter functional with swapchains
swapchain->currentFrameRenderTarget()->renderPassDescriptor() is not
functional at the moment, it returns null. This is because no backend
ensures that the internal renderpass descriptor object is exposed via
that getter in a QRhiSwapChainRenderTarget. Whereas in a
QRhiTextureRenderTarget this would work by design because there the
setter must be called by the user.

Fix this up, providing better API symmetry, and also reducing the need
to pass along QRhiRenderPassDescriptor objects seprately alongside a
QRhiRenderTarget in some places, e.g. in Qt Quick.

Change-Id: I42c4e9aaee3202c1d23bd093d840af80c5f8cd0f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-26 19:46:21 +02:00
Sona Kurazyan
6df137ca2f Platformsupport: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434
Change-Id: I4fa7ca58b4a298e81d35f19b439ed7702bd9700d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 18:59:42 +02:00
Sona Kurazyan
436774f153 Platformsupport: stop using QLatin1Char() for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

Change-Id: I58e00618fc8c82fad8d35a66c1d46e459bfc9de6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 18:59:42 +02:00
Tor Arne Vestbø
12fb2cfa11 macdeployqt: Ignore repeated references to binary when parsing otool -L
macdeployqt doesn't know or care about universal build (yet), and
will just scan all the lines produced by otool -L as if they were for
a single architecture, ignoring any lines it doesn't recognize.

This fails when the second arch starts off with a reference to the
binary we're processing, which then gets interpreted as a dependency
of itself. If that binary doesn't have a path, we end up looking for
a match in /usr/lib, which we can't find in the best case, or actually
end up deploying from an incompatible Qt version in the worst case.

Ideally we'd teach macdeployqt about the multiple slices, bur for now
we work around it by skipping any references to dependent libraries
that match the binary itself.

Fixes: QTBUG-102607
Pick-to: 6.2 6.3 5.15
Change-Id: Ia039fafdce90896e61aab90b9c8ac52543cc2c8c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-26 15:10:16 +02:00
Edward Welbourne
f056eed02e Clear tst_QSettings of deprecation warnings
Assorted QMetaType and QVariant methods deprecated in Qt 6 were still
in use - the deprecation warnings were suppressed by setting
QT_DISABLE_DEPRECATED_BEFORE=0 - fix them and clear that suppression.

Change-Id: I1aa8f45dcb5a18449b060b346c80ad70536896ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:16 +02:00
Edward Welbourne
2d0c603cdb tst_QSettings::testVariantTypes(): modernize list initializations
Change-Id: Ia84cd7590f9bcc95a790efb1e1dab46ab368cd2d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-26 15:10:15 +02:00
Edward Welbourne
7b909dccc2 Convert tst_QSettings::testVariantTypes()'s macro body into a lambda
Retain the macro, so as to automate checking
QTest::currentTestFailed() after return from the lambda.

Change-Id: If5873a533224ea3b809cef02255642a7d071d642
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
2b16997116 Clean up tst_QSettings::testVariantTypes()
Give the macro and its parameters clearer names, wrap the macro body
in do {...} while (0), use QCOMPARE() rather than QVERIFY()ing
comparisons, convert the result type to QMetaType::Type rather than
QVariant's deprecated equivalent, save one macro parameter by using
decltype() on another. Simplify one check by pulling out a common
sub-expression as a local variable.

In the process, give the settings keys meaningful names rather than
just "key" with a numeric suffix.

Ideally this test would be reworked to be data-driven, instead of
using macros, but the use of qvariant_cast<> to convert a read-back
value, along with the variable type of the input value compared to the
result of that cast, precludes this (as far as I can see).

Change-Id: I4e083cd0dea14d723910873829352e15740006bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
af61bb018f Rearrange tst_QSettings::testVariantTypes()
Move the large block unrelated to the macro-driven parts to before the
macro is defined. This makes it clearer that it has nothing to do with
the macro-driven part of the test. This is, in any case, a more basic
test of behavior, so may as well go first. Rename the tested key in
the process.

Change-Id: I783fcd812e36320e9bb9765bab3ec09b56d6e6e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
cfc2973eec Remove two unused resource files from tst_qsettings
Change-Id: Ia54fa1ffa6e739496667d1486ee7e5658cd6a74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
b0d55004b8 Inline a shared data-driven test table in tst_QSettings
Move its static populateWithFormats to before the class is declared
and make the _data() methods that call it (including one that did so
via another) inline so that we can see which are this simple - and
thus which aren't.

Change-Id: I71863244ba0e4bd188424b6a3f8d86d5d9f635a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
a7138c4fd1 Clean up includes involving tst_qmetatype_common.h
The functions it defines depend on many many types in QtCore for which
it did not have a #include; both files that included it thus had to
pull in QtCore to compile. Put that #include where it belongs and
clean out many specific QtCore includes that it makes redundant.

Change-Id: Ie9d9ec325d4879d771cb14baecb06fecbdaf62c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
76f9a768e8 Correct documentation of INI format's loss of type information
Although it loses type information for numeric types, it does preserve
the type of most other values.

This amends commit ee8a5f4917

Pick-to: 6.3 6.2 5.15
Change-Id: Id4d0e11eabff1874869b940c05055e0bebef5963
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Assam Boudjelthia
3a9aba287c Android: set useLegacyPackaging to true in build.gradle
Since we set android:extractNativeLibs to "true" in AndroidManifest.xml,
a warning is thrown by the gradle build, which needs the property
packagingOptions.jniLibs.useLegacyPackaging to be set to true.

Pick-to: 6.2 6.3 5.15
Change-Id: I725d2663d68ab88abfda630f8a61666510043967
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ramon Sadornil <ramon.sadornil@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-26 11:18:35 +00:00
Assam Boudjelthia
56dee3de5e Android: add missing properties in AndroidManifest.xml
Some missing values has to be defined in AndroidManifest.xml, otherwise,
warnings might be thrown.

* android:exported="true": because the manifest sets an intent-filter,
and it then has to explicitly to avoid the warning [1].
* android:allowBackup="true": this has to be explicitly set, we set it
to the default value here [2].
* android:fullBackupOnly="false": SDK 23+ use this to deteremine to
user auto backup or not, we set it to the default value here [3].

[1] https://developer.android.com/guide/topics/manifest/activity-
element#exported
[2] https://developer.android.com/guide/topics/manifest/application-
element#allowbackup
[3] https://developer.android.com/guide/topics/manifest/application-
element#fullBackupOnly

Pick-to: 6.2 6.3 5.15
Fixes: QTBUG-101320
Change-Id: I0872dc00e48a867154ec9ded26620383fb747918
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2022-04-26 11:18:35 +00:00
Sona Kurazyan
63b042fb21 QtWidgets: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Change-Id: I133b80334b66e0a5ab9546dd8e1ff0631e79601e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-26 09:01:26 +02:00
Sona Kurazyan
a7dc1e280b DBusConnection: reuse pre-defined constat values where possible
Change-Id: Ie32a0e87b1eed2db104bb23d58e747e651e04e63
Pick-to: 6.3 6.2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-26 07:01:06 +00:00
Sona Kurazyan
f0a72abfe3 AtSpiAdaptor: fix debug messages to output the values before clearing
Pick-to: 6.3 6.2
Change-Id: I945922c90396840128a79cb11443bf4ef5aadb13
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-26 09:01:01 +02:00
Sona Kurazyan
c1db1788c0 OpenGL: port away from QLatin1String
Replace the uses of QLatin1String with corresponding string literals
where applies, or with QLatin1StringView.

As a drive-by, fix formatting of a warning message in
qopenglengineshadermanager.cpp.

Task-number: QTBUG-98434
Change-Id: I12f4479637a8fe265138f240a1310d2d576454a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 07:00:43 +00:00
Yuhang Zhao
1ed449e168 Windows QPA: Only refresh the window theme if it really changes
WM_SETTINGCHANGE may be triggered in many different reasons,
we don't have to verify whether the system changes the global
theme or not in all cases. Although not officially documented,
there's a widely known and used technique to detect whether the
user actually changes the personalize settings or not, that is
when wParam is 0 and lParam is "ImmersiveColorSet", this
combination indicates system's personalize settings has been
changed. We can get rid of most unneeded verify of system theme
by only execute the logic in this specific case.

Change-Id: Iaf934c29975b3b2090fd692776f80b1125d3ddb3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-04-26 13:44:49 +08:00
Volker Hilsheimer
9f9be33180 Fix compiler warning from deprecated overloads
Change-Id: Id141c08dfe825ae39c57ba09a784dfdfd280fd0a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-26 06:55:17 +02:00
Lu YaNing
2f5f276b4a CUPS: Add support for accessible IPP printers
CUPS 2.2 adds accessible IPP printers to the list of destinations
that can be used. The "printer-uri-supported" option will be
present for those IPP printers that have been recently used.
https://github.com/OpenPrinting/cups/blob/master/cups/dest.c#L1611

Pick-to: 5.15 6.2 6.3
Change-Id: I49b4d2f1ee6d96e9bcc04ed1cc2ed48d7a6e7563
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-26 01:15:49 +00:00
Thiago Macieira
d7d6f46324 Fix build with GCC12: avoid QCborStreamReader::preparse()
GCC 12 doesn't like that we're calling preparse() on the empty
QByteArray() (whose .data() == &QByteArray::_empty), despite the
condition being impossible.

Reported at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105348

In function ‘void* qt_cbor_decoder_read(void*, void*, size_t, size_t)’,
    inlined from ‘void* read_bytes_unchecked(const CborValue*, void*, size_t, size_t)’ at cborinternal_p.h:234:51,
    inlined from ‘uint32_t read_uint32(const CborValue*, size_t)’ at cborinternal_p.h:271:25,
    inlined from ‘uint64_t _cbor_value_decode_int64_internal(const CborValue*)’ at cborparser.c:333:23,
    inlined from ‘uint64_t _cbor_value_extract_int64_helper(const CborValue*)’ at cbor.h:372:50,
    inlined from ‘void QCborStreamReader::preparse()’ at qcborstreamreader.cpp:769:59,
    inlined from ‘QCborStreamReader::QCborStreamReader(const QByteArray&)’ at qcborstreamreader.cpp:825:13,
    inlined from ‘QCborStreamReader::QCborStreamReader()’ at qcborstreamreader.cpp:790:37,
    inlined from ‘QtPrivate::QMetaTypeForType<QCborStreamReader>::getDefaultCtr()::<lambda(const QtPrivate::QMetaTypeInterface*, void*)>’ at qmetatype.h:2302:65,
    inlined from ‘static constexpr void QtPrivate::QMetaTypeForType<QCborStreamReader>::getDefaultCtr()::<lambda(const QtPrivate::QMetaTypeInterface*, void*)>::_FUN(const QtPrivate::QMetaTypeInterface*, void*)’ at qmetatype.h:2302:20:
qcborstreamreader.cpp:706:18: error: array subscript ‘unsigned int[0]’ is partly outside array bounds of ‘const char [1]’ [-Werror=array-bounds]
qbytearray.h:92:23: note: object ‘QByteArray::_empty’ of size 1

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e8485d34e36100
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-25 16:54:01 -07:00
Thiago Macieira
54eae2d610 QTextEngine: don't pass empty data to bidiReorder
The algorithm in QTextEngine::bidiReorder() doesn't like an empty level
and visual order list. Found by GCC 12's slightly misleading warning:

qtextengine.cpp:3838:29: error: ‘levels’ may be used uninitialized [-Werror=maybe-uninitialized]
qtextengine.cpp:1174:6: note: by argument 2 of type ‘const quint8*’ {aka ‘const unsigned char*’} to ‘static void QTextEngine::bidiReorder(int, const quint8*, int*)’ declared here
qtextengine.cpp:3835:28: note: ‘levels’ declared here
 3835 |     QVarLengthArray<uchar> levels(nItems);
      |                            ^~~~~~

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e8490f131f160e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-25 16:54:01 -07:00
Thiago Macieira
e92e48bc79 XCB: fix GCC 12 warning about uninitialized variable use
GCC is right that symbolsGroup2 could remain uninitialized for some
conditions. So always initialize it.

qxcbkeyboard.cpp:284:48: error: ‘symbolsGroup2’ may be used uninitialized [-Werror=maybe-uninitialized]

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e84af7d7806b0d
Reviewed-by: Zhang Hao <543985125@qq.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-25 16:54:01 -07:00