Qt6 makes sizes qsizetype; and one of these was already sizeof()-sized.
While qsizetype might not be ssize_t, it's at least no bigger, so we
can safely use its format specifier, with a suitable cast.
Change-Id: I433f654f6b139d74b4d5358b804b44ab1f0ada15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Removed three warnings, rather than fixing them, as Konstantin Ritt
tells me they've been redundant since Unicode 6 or so.
Change-Id: I4507e852bceb08a0252c77a8b383aceac212aad9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Don't include a QString::number() in a sum of QByteArray and C strings.
Change-Id: I7544e835fcf5625b1fe1ee2055a48600200daafd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We can end up in a situation where a (soon to be destroyed) observer is
owned by a binding which is about to be deleted. If in that situation
the binding is destroyed first, we end up with a dangling pointer
and ensuing memory corruption. Instead, we now first transfer the
ownership of the observer and only destroy the binding afterwards.
Fixes: QTBUG-85824
Change-Id: I721c0319281ada981ae7896bd2e02e9a0cc901b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The subsurface sync/desync functions were unimplemented on the
qtwayland side, so this is all dead code. We will introduce the
platform interfaces if an actual use-case with an implementation
comes up.
Task-number: QTBUG-84220
Change-Id: I921ee7262e5f0a7171058aaf0ff2102d9e6f438e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Fixes warning by Clang:
warning: 'const volatile' type qualifiers on return type have no effect
[-Wignored-qualifiers]
const volatile unsigned long long * const volatile func_KVPKVull() {...}
^~~~~~~~~~~~~~~
Change-Id: Ia4aae6521c84f4a18d92ad5035af5b247d283140
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We need them to implement qHash for QQuickPixmapKey.
Change-Id: Ia67de25ec0068b9e1b889bc9c6ee077e24eb71a8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Made QPromise::swap public, added free standing swap() for
QFutureInterface and QPromise. Updated QPromise special member
functions. Extended tests
Task-number: QTBUG-84977
Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Pick-to: 5.15
Fixes: QTBUG-85749
Change-Id: Ie77145e851ff64d4c88fce7211135d66e9b94a84
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This amends 0ef46b41d8 to ensure the
new configuration is styled correctly for qmake.
Task-number: QTBUG-80938
Change-Id: Iebfff3ff0570d2e92d01d4eb1178c0d6261468f9
Pick-to: 5.15
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Just T makes qdoc's clang parsing fail, it needs template<typename T>.
Also, the return type is T*, not T.
Change-Id: I210676aff3122b432888c3d79d9967e249ac88e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add dummy typedefs just for qdoc, this way the types show up in
the generated docs.
Change-Id: I408eeb5c4c1cbbb8cd7df8ca3c9c6b7c64b0ca88
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Trying to be clever seems to cause issues on some systems, for example
AMD (RADV) on Ubuntu 20.04 gives totally garbled output by default.
Remove the undocumented ALWAYS_SET_MODE env.var. as well, it won't have
much of a purpose since we'll in effect hit the SetCrtc path always now
once on startup.
Change-Id: Ibaa463ff913eb0c1251d6d3435aa4799fe5c8a29
Fixes: QTBUG-85797
Pick-to: 5.15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Attempting to reflect reality with the value of AA_ShareOpenGLContexts
was a valiant attempt, but it is not possible to do setAttribute without
getting a warning now once QGuiApplication is constructed. So just leave
the attribute as is, changing its value is not strictly required.
Fixes: QTBUG-85796
Pick-to: 5.15
Change-Id: I0f0f981bb4883856b216b2a9aad3b5bf2d7da01a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
We already had append(const QList &) and now there's an overload
taking an rvalue reference.
Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't appear to have implicit fallthroughs in our code anymore. The
last deprecated copies and redundant moves are also gone.
The other warning never had an explanation and doesn't show up when
building full Qt anyway.
Change-Id: Iad959315ad374ef288f5fffd15d683599a1a11b9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Commit daaa557259 changed the enum to
bool, but the warning is still happening.
Pick-To: 5.15
Change-Id: Ibdc95e9af7bd456a94ecfffd1603f332a356c788
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I don't know why std::shared_ptr allows this, but why not.
[ChangeLog][Important Behavior Changes] QSharedPointer objects will now
call custom deleters even when the pointer being tracked was null. This
behavior is the same as std::shared_ptr.
Fixes: QTBUG-85285
Pick-to: 5.15
Change-Id: I24006db8360041f598c5fffd161c260df0313b55
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
‘t’
Specifies that the argument is a ‘ptrdiff_t’.
This modifier was introduced in ISO C99.
We use qsizetype, which is the same width as ptrdiff_t, so it makes no
difference in va_arg().
Change-Id: Iea47e0f8fc8b40378df7fffd16255730109413a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Deprecated in 5.15 in favor of CBOR.
Fixes: QTBUG-81239
Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
keys() and values() can be slower for large containers.
I ran into this recently when profiling, and was surprised that keys()
had to build the list of keys (by appending in a loop).
Pick-to: 5.15 5.12
Change-Id: I73215f5a917790236704ad7ef78cefc4a049cd89
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The error was:
src\virtualkeyboard\qvirtualkeyboardinputcontext_p.cpp(305): error C2678:
binary '!=': no operator found which takes a left-hand operand of type
'QList<QInputMethodEvent::Attribute>' (or there is no acceptable conversion)
This patch fixes the issue by manually defining an operator== for
QInputMethodEvent::Attribute.
Change-Id: Idb283cf7b6ff4388a38ea7780c3d5c1c5f77038d
Fixes: QTBUG-85789
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Our hardware optimized conversions of float to qfloat16 rounds to even
where our table based conversion truncated to zero.
The rounding is not in this patch exactly round to even like the
hardware implementation but much closer.
Change-Id: I4c5e72c15fef9079d3660680b2727ff7ba4e768a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In the case we don't have an array of structs, structPrefix needs to be
suffixed with a dot to get the proper uniform names.
Change-Id: I50ed54c2f7c3cc4556ed1854419bc4fe3a2989f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This adds the option to build Qt with libb2, which is especially
recommended, if you care about the performance of the BLAKE2 hashing
algorithms. The bundled version is the pure reference C implementation
of BLAKE2, while libb2 has many additional hardware optimizations.
However, the API of both is the same, so no changes to the code were
necessary here.
Change-Id: I3563982f4e07be300291fe103c38b16a404b3ebb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
BLAKE2 does not specify requirements about specific hash sizes and
since QCryptographicHash does not support dynamic hash sizes, only the
most common hash sizes could be covered by this.
The supported hash sizes were chosen to match the ones supported by the
Linux kernel.
The new hashing algorithms for QCryptographicHash are:
* BLAKE2b (160 bit, 256 bit, 384 bit, 512 bit)
* BLAKE2s (128 bit, 160 bit, 224 bit, 256 bit)
[ChangeLog][QtCore][QCryptographicHash] Added BLAKE2b and BLAKE2s
hashing algorithms.
Fixes: QTBUG-78198
Change-Id: Id9e0180a974093982fdf1cdd6180988a2e5e9f4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is required for adding support of the BLAKE2 hashing algorithms in
QCryptographicHash.
Change-Id: Icc981c3a99a2713fdd1c18766b05619254650622
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Often a simple change in the styleoptions is needed in e.g a paintEvent,
but it was impossible without copying the whole paint-function which
is not always trivial and also wouldn't be kept up-to-date if it was
changed in Qt.
The initStyleOption is similar to viewOptions in QAbstractTableView
and it is handy that this function is virtual. Furthermore
QStyledItemDelegate::initStyleOption is already virtual.
This change only makes initStyleOption virtual for public classes.
[ChangeLog][QtWidgets] InitStyleOption has been made virtual in
public Qt classes to make override of stylebehavior more simple.
Change-Id: I38974c6d4dd0793ca5976ecf3aa28892215a1579
Task-number: QTBUG-77642
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Apply the same kind of transformations to the contents of the prl
files as we do for pri files. Mainly, transform system library paths
that are absolute, into link flags to make them relocatable across
systems.
Also change the Qt frameworks to be linked via the -framework flags
instead of via absolute paths.
Implementation notes
Move the common required functions for both QtFinishPrlFile and
QtGenerateLibPri into a common QtGenerateLibHelpers.cmake file.
Make sure it's listed as a dependency for the custom commands.
Also make sure to pass the necessary input values like possible
library prefixes and suffixes, as well as the link flag.
Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: I36f24207f92a1d2ed3ed2d81bb96e4e62d927b6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
QFileInfoGatherer creates QFileInfo objects in the worker thread to
offload the work from the UI thread, but it never calls any methods on
the QFileInfo objects that would trigger a stat'ing of the files. For
large directories on remote file system, that easily results in the
UI thread being blocked for a very long time.
Add a private 'stat' method to QFileInfo which allows forcing it to
stat all attributes from the worker thread, and make
QFileInfoGatherer a friend so that it can call the function from the
worker thread. This way, QFileSystemModel can access the cached data
for each QFileInfo object, without having to touch the file system
from the UI thread.
Also reduce the amount of signal emissions for drive information,
batch all drives (which can safely be assumed to be at most a two
digit figure) into a single emission instead.
Change-Id: Ifdcae150406187db9984d0fec9add93597b5f85b
Fixes: QTBUG-41373
Pick-to: 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Only keep 3, 4, and 5 because 3 is the lowest version where binary JSON
is not used anymore.
Change-Id: Id0319e8eceb845017ed493d0ef6902b53050d5a6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Changes pro2cmake to handle load(qt_app) projects and write out
qt_internal_add_app calls.
Also adds handling of macOS and Windows specific resource files for Qt
apps only.
Task-number: QTBUG-85757
Change-Id: I994d8d19ab2ae366a985cab7894b97d6a278a56f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This new function is meant to be used where load(qt_app) is used.
It delegates functionality to qt_add_executable, while handling
some additional behavior via a finalization function (mostly handling
of macOS Info.plist files and icons, as well as Windows icons and
resource files)
It uses a new PlatformAppInternal interface target.
Task-number: QTBUG-85757
Change-Id: I1a2d5851b137fcd4a6323e0e06fb154f91619800
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
We already have the information in the QMetaTypeInterface, and provide
functions to access sizeof. Adding alignof support seems natural, and
should make it easier to handle over-aligned types.
This should also be helpful in QVariant.
Change-Id: I166be76f4b7d2d2e524a3a1e513bd2f361e887c1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
size() - 1 is converted to int as the result, but size() is a qsizetype
and could be bigger than INT_MAX. So rewrite to not depend on the cast.
This was introduced on b2f79cceb1.
I could have replaced size() - 1 with int(size() > 1) - 1, but that's
even more complex. To simplify, I split the function in two while
retaining the C++11 constexpr requirements.
Bonus: removes the use of the ambiguously-named "empty()" function that
looks like a verb.
Fixes: QTBUG-85665
Pick-to: 5.15
Change-Id: Ieffc3453b88c4517a1dbfffd162338fdb084a376
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
No need to change the output variable from int to qsizetype. That would
complicate the use of libdouble-conversion, which uses ints.
Change-Id: Iea47e0f8fc8b40378df7fffd1624bfdba1189d81
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The docs didn't make clear that there's a case where a rather poor
locale-aware compare may be in use - which turns out to be in use on
Android.
In the process, stop duplicating (in two slightly different variants)
the same paragraph in many places when we can use a \sa to refer to a
sub-section of the class doc.
Pick-to: 5.15
Task-number: QTBUG-63518
Change-Id: I5a41b0a269e477e74236131310992e70462734d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>