The logic is now mostly handled in QGuiApplication, with QApplication
only dealing with the widget-specific palettes and interaction between
the style and the palette.
The application now picks up changes to the platform theme and will
re-resolve the current application palette appropriately. This also
works even if an explicit application palette has been set, in which
case any missing roles are filled in by the theme.
The palette can now also be reset back to the default application
palette that's fully based on the theme, by passing in the default
constructed palette (or any palette that doesn't have any roles set).
This is also correctly reflected in the Qt::AA_SetPalette attribute.
Conceptually this means QGuiApplication and QApplication follow the
same behavior as QWidget, where the palette falls back to a base or
inherited palette for roles that are not set, in this case the theme.
Behavior-wise this means that the default application palette of the
application does not have any roles set, but clients should not have
relied on this, nor does QWidget rely on that internally.
It also means that setting a palette on the application and then
getting it back again will not produce the same palette as set,
since the palette was resolved against the theme in the meantime.
This is the same behavior as for QWidget, and although it's a
behavior change it's one towards a more sane behavior, so we
accept it.
[ChangeLog] Application palettes are now resolved against the platform's
theme palette, the same way widget palettes are resolved against their
parents, and the application palette. This means the application palette
reflected through QGuiApplication::palette() may not be exactly the same
palette as set via QGuiApplication::setPalette().
Change-Id: I76b99fcd27285e564899548349aa2a5713e5965d
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
...but keep support for deserializing for all older versions in order to play
nice with existing .qsb files.
The usage of binary JSON and then CBOR is a historical artifact: relying
on the QJsonDocument (which we generate for purposes unrelated to binary
serialization) was a convenient shortcut. However, writing to and
reading from a QDataStream instead (which QShader already does) is trivial.
In order not to be limited by potential CBOR requirements in the future,
take it all into our own hands.
Extend the qshader autotest accordingly.
Task-number: QTBUG-81298
Change-Id: If0047b659bd6601ca47b5bbbce1b719630cde01e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The new float16texture_with_compute manual test demonstrates a case
that was not handled correctly before: multiple dispatch() calls in
a row storing to and then loading from the same subresource(s).
Without the appropriate barriers subtle data corruption issues appear.
For Vulkan this also adds better batching for image/buffer barriers when
using deferred recording.
Also, for OpenGL this fixes the case of updating a buffer or rendering into
a texture and then using it for load/store in a compute pass (previously this
also lacked an appropriate glMemoryBarrier).
Task-number: QTBUG-81217
Change-Id: I7970c445564473f9452662f4b1a20618cb8627a3
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
What's more, demonstrate two types of rendering to a cubemap:
one by one to each face, and by attaching all faces as color
attachments in one go.
Both are used by Qt Quick 3D in connection with shadows, so this
proves that the same is possible to implement with QRhi.
Task-number: QTBUG-81261
Change-Id: I5c7077224d7cae0dd6ea02ac30a9e6f9f1f0c229
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Uses the two compute shaders from Qt Quick 3D. Demonstrates
and tests both RGBA16F textures and using them (and doing
load/store with mip levels individually) in combination with
compute.
Task-number: QTBUG-81213
Change-Id: I3f0f250d5997a26c857b7c45517684c63b44e58e
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
The standard makes them as big as int_least16_t / 32_t, i.e. big
enough to hold UTF-16 / UTF-32 code units. We're relying on them
to be *exactly* 16/32 bit instead.
Drive by: move the check that a char is 8 bits before saying that
some other type is not its expected sizeof() * 8.
Change-Id: Idbf3d33331667d417702d9dde221905bcfc4d021
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Minimal fix for the missing wakeup issue, in leu of
a new event loop implementation.
So far, emscripten_async_run_in_main_runtime_thread_
looks to be our option for scheduling calls on the
main thread. This function is available on emsdk 1.38.22
and higher.
Requires making from QEventDispatcherUNIX::wakeUp()
non-final. The future event dispatcher implementation
will not inherit QEventDispatcherUNIX, so this is a
temporary change.
Fixes: QTBUG-75793
Task-number: QTBUG-76007
Change-Id: Ie6f6ee6f7674206fc0673a4fe866ac614432ab65
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Use QStringIterator rather than indexed loops. This fixes handling of
non-BMP code points (which may be lower or uppercase, see the test).
Change also the semantics of the functions, adopting Unicode §3.13
definitions: a string is lowercase/uppercase if it's equal to its
own toLower/toUpper folding.
As a side effect, empty strings are now correctly reported to be
lowercase AND uppercase.
[ChangeLog][Important Behavior Changes] The semantics of
QString::isLower() and QString::isUpper() have been changed to match the
Unicode specification. Now lowercase (resp. uppercase) strings are
allowed to contain any character; a string is considered lowercase
(resp. uppercase) if it's equal to its own toLower() (resp. toUpper())
folding. Previously, a non-letter character would make the string not
lowercase nor uppercase, and the mere presence of an uppercase (resp.
lowercase) letter would make isLower() (resp. isUpper()) return false,
even if the letter wouldn't change under case folding. As a
consequence, now empty strings are lowercase and uppercase.
[ChangeLog][QtCore][QString] Fixed a number of bugs of
QString::isLower() and QString::isUpper(). Empty strings are now
correctly reported to be lowercase (resp. uppercase), and strings
containing code points outside the BMP are now correctly handled.
Note that the behavior of these functions has also been changed.
Change-Id: Iba1398279a072399a9f21295fe75f6e414f3f813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Sort alphabetically and add recent relevant options with version
information.
Change-Id: I10c8cc82ce357775ed68cb811a0c906cd38633a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To disambiguate &QSslSocket::sslErrors() expression. Add a new
getter - sslHandshakeErrors().
[ChangeLog][Deprecation Notice] QSslSocket::sslErrors() (the getter) was deprecated and superseded by sslHandshakeErrors()
Task-number: QTBUG-80369
Change-Id: I9dcca3c8499800c122db230753dc19b07654f8a2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Binary Json is deprecated and we should not use it. We can already
serialize shaders to CBOR. Push the deprecation warning mechanism to the
only user of fromBinaryJson().
Change-Id: I1d56157ab92f74eaab49400be647317e7833e35e
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QLocalSocket::error is overloaded as a signal and an accessor (for the
error reported by the signal). This means connecting to the signal using
a pointer to member function would require ambiguity resolution. We
deprecate the old accessor (to be removed in Qt 6) and introduce a new one -
'socketError'.
[ChangeLog][Deprecation Notice] QLocalSocket::error() (the getter) is deprecated; superseded by socketError().
Task-number: QTBUG-80369
Change-Id: Iab346f7b4cd1024dee9e5ef71b4b7e09f6d95b12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The one that is a getter for the last error found. This is to disambiguate
the expression '&QAbstractSocket::error'. Introduce a new member-function
socketError as a replacement.
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the getter) is deprecated; superseded by socketError().
Task-number: QTBUG-80369
Change-Id: Ia2e3d108657aaa7929ab0810babe2ede309740ba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Clang does seem to understand __declspec(nothrow) as
used by the COM macros like STDMETHOD. Suppress the warning,
fixing errors like:
qwindowsfontenginedirectwrite.cpp(105,24): error: 'AddBeziers' is missing exception specification '__attribute__((nothrow))' [-Werror,-Wmicrosoft-exception-spec]
Task-number: QTBUG-63512
Change-Id: If582cb0c12c62a7d12c4ae702747aac1f735db3c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The windows filesystemwatcher did not watch for attribute changes for
directories (e.g. hidden flag) so it was not in sync with other
backends. Fix it by adding FILE_NOTIFY_CHANGE_ATTRIBUTES to the watch
flags when watching a directory.
[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that caused QFSW not
to watch for attribute changes on Windows. Now it will correctly report
when files and directories become hidden or unhidden, for example.
Fixes: QTBUG-80545
Change-Id: I31767a0da899963e3940b4f5b36d1d581e6aa57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
A direct logical replacement. Not sure what is going on though or why
an inversion is necessary, but logic is unchanged.
Change-Id: Id9b5531895371f6467018fa82336aff6238ae126
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
If the user derived from QProcess, it's likely to override the
setupChildProcess() virtual. Unlike fork(), the system calls for
enhenced functionality (FreeBSD pdfork() and Linux's clone()) won't call
pthread_atfork() callbacks and the environment in the child process
could be inconsistent. Qt's own code is safe, but we can't make the same
statement about users' code.
So we err on the safe side for correctness and run the old, less safe
implementation (thread-unsafe, subject to hijacking of the signal
handler, etc.).
Change-Id: Ia2aa807ffa8a4c798425fffd15d9703bd03f6f09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The detection code for Linux 5.2 and 5.3 went unused. We had it in the
initial commit so it got recorded for posterity, in case someone wants
to detect them (the road not taken).
Change-Id: Ib5d667bf77a740c28d2efffd15cccdff5aa5a622
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Linux 5.2 added the CLONE_PIDFD flag to the clone(2) system call. Linux
5.3 also added the clone3(2) system call, which allows both CLONE_PIDFD
and CLONE_PARENT_SETTID, which we could use but don't really need.
Unfortunately, 5.2 missed one crucial and one convenient change. Without
the P_PIDFD support in waitid(2), we would need to either remember the
PID of the child process or obtain it from /proc. But without support
for polling on pidfds, we can't find out when the child process
exited. Support for the latter was added in 5.3, which would be
sufficient for us, but it's not easy to detect it at runtime. The
support is also being backported to Android's 4.9 kernel[1], so we can't
do version checks, only functionality.
This commit relies on waitid(2) support, which was the last to be added
and is fortunately the easiest to detect. If it's present, we assume the
whole series is present and use pidfds.
[1] https://android-review.googlesource.com/q/topic:%22pidfd+polling+support+4.9+backport%22
See-Also: https://lkml.org/lkml/2015/3/12/1044 (original idea)
See-Also: https://lkml.org/lkml/2019/4/19/441 (CLONE_PIDFD)
See-Also: https://lkml.org/lkml/2019/4/25/884 (poll(2) support)
See-Also: https://lkml.org/lkml/2019/7/27/334 (P_PIDFD)
Change-Id: Ia0aac2f09e9245339951ffff13c94b3aa13d8b63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Can be relevant for Qt Quick 3D shadows, where the shadow map is R16F.
Task-number: QTBUG-81268
Change-Id: Ic33e100929e133d1cbe0b062a15697c82536f62a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Checking for nullptr is insufficient: just because there
is an empty map present, it does not mean it is valid. The
two cases must be handled identically.
This fixes a regression when using QShaders that do not
have an associated native resource binding map.
Amends 4639660ded
Change-Id: Icb239bf9a9261ed32f2cb7b22c60b608195618fc
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Based on the documentation for positionFromPosition, if the resulting
position is less than 0 or longer than the text, then we should return
nil. This fixes problems with placement of the cursor and selection
rectangle when auto-completion is used.
Fixes: QTBUG-79445
Change-Id: I44a18881527a8a22012fe5fcbbc3216e60c48bc9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The test was previously tracking all Change events,
which made it fragile.
Change-Id: I17872341237009a9a0a2ad2fd5482f917991d7b2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Also remove the example code for deprecated methods and use CBOR instead
where it makes sense.
Task-number: QTBUG-81068
Change-Id: Iffb7a4b3d7b16a1e485fc05b3ab2e2468e9e0718
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Since 072ca960f5 changed the default
of the styles example back to Norwegian Wood, it is no longer
suited as gallery example.
Extract the dialog from it and re-add it as a gallery example Add a
tooltip displaying the class name and a help shortcut opening the
documentation.
Restructure the group boxes to add more widgets.
Remove the gallery meta-tag from the styles example.
Task-number: PYSIDE-1112
Change-Id: Ie6f13084012771bd8f5bf9cad23b58d0720fdd92
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
It had create()'s default number options when passed to create, so
wasn't useful then; and otherwise shadowed the value held by the
cached private for the default locale. Noticed in the course of adding
an analogous global for the system locale.
Drive-by - eliminated a redundant language != C check.
Change-Id: I5601dc09188804c11dede5be460bfdd12b8152ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add missing \sa lines, clarify what the exponential character is and
mention that C is an exception to the "no number options set".
Change-Id: I13ca483a07738908640408e0ca512de31586cec9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QLocale methods that report the fragments used in making up
numbers all return QChar. A note dating from before Qt5 times warned
that we need to change these to return QString (since we might need a
surrogate pair to represent the relevant characters). Give advance
warning in the documentation that this shall happen at Qt 6.
[ChangeLog][QtCore][QLocale] decimalPoint(), groupSeparator(),
percent(), zeroDigit(), negativeSign(), positiveSign() and
exponential() still return QChar but shall be changed to return
QString in Qt 6. Callers are encouraged to switch to QString early,
exploiting the QString(QChar) constructor.
Task-number: QTBUG-81053
Change-Id: Ia802c7665676ecf13669c6a6f173f2e70eac578e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
To be feature parity with evdev touch which already supports this
Change-Id: Ie7f9c868ea888725b24c3855106e1c0c0ba943a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The actual logging code, qt_message_print(), uses toLocal8Bit(), so
testing by comaring with toUtf8() isn't robust.
Change-Id: I7d6614e4af8c679674dbbf4ff47a88b2b75fc2dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix tst_QNoDebug::streaming() to use toLocal8Bit(), to match
QTestLog::ignoreMessage(), which uses fromLocal8Bit().
Change-Id: I65f7b995a582aeab7b7ba61781a229fecd1ed3c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Returning a QByteArray required doing a toUtf8() to a QString on one
of its paths, which was promptly undone by its caller using
fromUTf8(), since a QString was needed anyway.
Drive-by - remove spurious default for parameter in method definition.
Change-Id: I45f553d74cd0ba9dab25c439ba8291c00b7ceb5b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The device counts were used before they were initialized, causing
problems e.g. with mouse cursor.
Fixes: QTBUG-81207
Change-Id: Ic9dadcaebeb4c4a64bb506e4236d5a9260e0fdbc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Obsolete SDK_INT Version Check
------------------------------
This check flags version checks that are not necessary,
because the minSdkVersion (or surrounding known API level)
is already at least as high as the version checked for.
The mindSdkVersion in templates/AndroidManifest.xml is 21 for Qt 5.14
and androiddeployqt also ensures that the minSdkVersion is not below 21.
Change-Id: I452de5b152f572efc69e6b292a8b15dbbfba639b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit b8e404f6d0631e04d30a864dc68b0574bfca90f1)