Commit Graph

56224 Commits

Author SHA1 Message Date
Samuel Mira
08a4fd3570 Android: Fix ANR when QtService and QtActivity load in same process
This patch is a fix to prevent the ANR. In this patch, the QtService
queries QtNative if there is a QtActivity or QtService started and,
in case there is, it does not begin the loading process. When that
happens, the QtService will be a regular android Service.

Fixes: QTBUG-99691
Pick-to: 5.15 6.2 6.3
Change-Id: Ibd8aa8554107a9744b53cca4e0dd7e6f9b25baea
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2022-04-28 22:14:00 +00:00
Dmitry Shachnev
189bcbea07 QPdfEnginePrivate: generate link only when there is a href
Otherwise, when anchor is just something that can be linked to (not a
link itself), it will result in a PDF link pointing to an empty URI.

See https://github.com/retext-project/retext/issues/580.

Pick-to: 6.3
Change-Id: Ib3c71797b09579783d74505601bad08c84856719
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-28 22:06:32 +03:00
Richard Moe Gustavsen
bfd10af245 QIOSTextResponder: restore reset/commit logic
After 2211092aa5, parts of the reset/commit logic
was left out by a mistake. This patch will add the
missing lines back into the text responder.

Task-number: QTBUG-102960
Pick-to: 6.3
Change-Id: Ib339eae2af69ce088e251fe8571bed97bbd64fc3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-28 17:43:10 +02:00
Sona Kurazyan
d3457c39c4 QtXml: replace QLatin1String uses with _L1 or _s
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Task-number: QTBUG-98434
Change-Id: I4f337501e4cf445ded75b414a41bbd85dfd38900
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-28 15:17:23 +02:00
Sona Kurazyan
79cf895c70 QtTestLib: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

Change-Id: I3debae5f481037958bfb65caabca97a0d4681eb9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-28 11:15:11 +02:00
Marc Mutz
c038fa9e77 QtNetwork: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: Ie027419956d98c971429f2b4c7ae6f8f56c094f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
d792e8d90b QLinuxFbIntegrationPlugin: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: I585374e1e4e304f6c078744b36e0a021a938390d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
569c6dbafc QVncIntegrationPlugin: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: I540916c8dc93d3b13bbf6d2ca9e1a1d1a7685621
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
d2b3ca1e36 QSQLiteDriverPlugin: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: I3ad19796499e5fd4bb2bd1a495aeed7729890650
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
a4783b49fa QMYSQLDriverPlugin: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: Idf1a38d8a293e3cbf74443f00d2a9765eb68a9c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
d333cfbd5c QIbusPlatformInputContextPlugin: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: Id5ac448dc99789ad2675e89c79be8bf4aef036ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
602e6ae21d QComposePlatformInputContextPlugin: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: Ie56a3b402ee8e1ed258a3b7e12dae3eb663bc03d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
e21df99708 QtSql: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: Id758d672710ba998595824645e3e16e00537781d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
82cf06fc21 QtTest: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: I9378ddcabbfa0ec5ca895f6ce55ab5f1ec2cade3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
1ca7b51694 Image Plugins: includemocs(-ish)
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

The result of the automated script is no good here, because these
plugins all use the same anti-pattern of defining the plugin class in
a header, main.h, which doesn't have include guards. Included moc
files therefore lead to redefiniton errors.

Fix by inlining the main.h's into the respective main.cpp's and
including main.moc's instead.

Task-number: QTBUG-102886
Pick-to: 6.3 6.2 5.15
Change-Id: I6d3ec5590d13d9b7a4cedd5f1b4d3331e6916655
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:03 +02:00
Marc Mutz
7d4b480be3 QtDBus: includemocs
Including moc files directly into their classes' TU tends to improve
codegen and enables extended compiler warnings, e.g. about unused
private functions or fields.

Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-102886
Change-Id: Id5892f146f9792a0c5c8df24c7750a4089b07c6e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-28 11:15:02 +02:00
Marc Mutz
e48b4d2b7c Implement support for '0b' prefix in toInt() etc
[ChangeLog][QtCore][QByteArray/QByteArrayView/QLatin1String/QString/QStringView]
The string-to-integer conversion functions (toInt() etc) now support
the 0b prefix for binary literals. That means that base = 0 will
recognize 0b to mean base = 2 and an explicit base = 2 argument will
make toInt() (etc) skip an optional 0b.

[ChangeLog][QtCore][Important Behavior Changes] Due to the
newly-introduced support for 0b (binary) prefixes in integer parsing,
some strings that were previously rejected as invalid now parse as
valid. E.g., Qt 6.3 with autodetected bases would have tried to parse
"0b1" as an octal value and fail, whereas 6.4 will parse it as the
binary literal and return 1.

Fixes: QTBUG-85002
Change-Id: Id4eff72d63619080e5afece4d059b6ffd52f28c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-28 08:40:19 +00:00
JiDe Zhang
7a5d7e8440 Optimize the QPalette::resolve from the other palette
If all the palette's colors are resolved, nothing needs to be done in
QPalette::resolve(const QPalette &other).

Change-Id: I1573cfa5b5cd1e7eb15f3242aff6ab92e9f8c84b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-28 09:24:39 +02:00
Andreas Hartmetz
5165b89e2b Document the default value of QSFPM::sortOrder()
...and how to change the value, which is by calling sort().
Also, this is not a property either.

Pick-to: 5.15 6.2 6.3
Change-Id: I1b1be90dc43c29e85903a33d0f99569fd6c87abb
Reviewed-by: David Faure <david.faure@kdab.com>
2022-04-28 08:18:53 +02:00
Andreas Hartmetz
d39bd46fa2 Better document how to enable sorting in QSPFM
This can be a big time sink otherwise. Unlike reimplementing
filterAcceptsRow() for filtering, reimplementing lessThan() is
*not* sufficient to enable sorting.
As a drive-by, change \brief to \return because sortOrder() is not
a (formal) property.

Pick-to: 5.15 6.2 6.3
Change-Id: I7e7be6f1e8e6b03a9923a7f77f04005b19a69d41
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2022-04-28 08:18:52 +02:00
Sona Kurazyan
9a55c695c7 QtGui: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: I98c27030c783f968cbf38dc966ce486dc366b302
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-28 05:58:52 +02:00
Sona Kurazyan
7b6b133746 QtGui: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434
Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-28 05:58:52 +02:00
Lorn Potter
852bb43605 wasm: fix window leave and enter events
Leave and enter events are not happening
when the mouse enters or leaves the browser
window/canvas.

Done-with: Alexandra Cherdantseva <neluhus.vagus@gmail.com>
Change-Id: I702584980c6bea6a36143281de658e566e4c155b
Pick-to: 6.3
Fixes: QTBUG-100950
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-28 12:44:04 +10:00
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