The typed permission classes' properties, insofar as they have any,
should default to the least-intrusive capabilities.
QLocationPermission implements it that way, but these two typed
permissions defaulted to read-write access instead of read-only. This
was fixed in an earlier commit. However, default values of properties
are most natural when they're equal to the default-constructed value
of the property's type, and this was no longer the case for
isReadOnly.
By renaming the property to isReadWrite, defaulting to false, this
relationship is restored, and code using the classes looks more
natural:
- p.setReadOnly(false);
+ p.setReadWrite(true);
Found in API review.
Pick-to: 6.5
Change-Id: I4efa4c0326b5a54181c96f477709b0686c963e90
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Non-polymorphic classes should not be exported wholesale, because MSVC
exports inline API in such classes, too, which has caused numerous
problems over the years.
Only export individual functions.
Pick-to: 6.5
Change-Id: I8be55c1fcdb21d143a02bb62498caeea6ebca068
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The Q<Typed>Permission classes get their \since via \include
permissions.qdocinc permission-metadata, but using that for
QPermission will break the \annotatedlist permissions trick used all
over the permission docs, because QPermission would then be included
in the list. The use of this mechanism needs more thought; QPermission
shouldn't really be excluded from being \ingroup permissions.
Pick-to: 6.5
Change-Id: I33207ffb39c04c23fb479c173e97dc0adb60691f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
OpenSSL doesn't allow to add additional data when the hash has been
finalized. To fix that, we just make a copy of the current context
and call EVP_DigestFinal_ex() on the copy so we can still later add
additional data.
Pick-to: 6.5
Change-Id: If76d4ec56f8846d6ef55ed7ec7cbab440d43edd0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Consider a cross build of Qt with qtbase, qtshadertools and
qtdeclarative. If a user projects only links against QtQml without
creating an actual QtQuick module, no host tools from qtdeclarative are
needed.
Normally, find_package(Qt6Qml) pulls in Qt6QmlTools and errors out if
it's not found. By setting QT_ALLOW_MISSING_TOOLS_PACKAGES when
configuring Qt, one can disable the error and build a user project such
as the one outlined above.
Pick-to: 6.4 6.5
Fixes: QTBUG-109547
Change-Id: I45e727713912d19e6007a7fbf3d61533f82b71d9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
Using enum for named constants is old-fashioned.
Also test it using if constexpr, since we can.
Change-Id: I1fc4ed975e12403bc724b39f9335f3797acfafb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The documentation says that the size argument to wcsxfrm should include
the null terminating character. Currently it doesn't, which breaks
collation, as the last character is omitted.
Task-number: QTBUG-109954
Change-Id: Ic0c78a617ed1d50e31e50cae56e21675d2069ead
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qt_ntfs_permission_lookup is a non-atomic global variable that is prone
to data races. Make a remark about this in the documentation.
Task-number: QTBUG-105804
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: If7c64f3ab7d2c3b1487fe56204a4e66c420b0604
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
To be extended as neeeded.
Pick-to: 6.5
Change-Id: I57d2f55f67de073fe3e4916b7ba655342cf661dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
These were found with the help of -Wdangling-reference, which is
new in GCC 13.
The one in qtpaths.cpp is a false positive: parseLocationOrError()
returns a reference, so there's nothing for the full expression to
destroy. Moreover, it returns a reference to a static object, so
there's no destruction inside the function either.
The other two aren't, but are also harmless. QDBusMessage::arguments()
and QVariant::toList() return a stored QVariantList by value, so
QList's COW mechanism means at() returns a reference that will not be
destroyed. However, the compiler has no way of knowing that. And
since it depends on the implementation details, change the code to
not depend on that.
Pick-to: 6.5
Change-Id: If53aa16fcc24586d752ffc76c193c81e43dc9d95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We can declare that headers like qtnoop.h and qtypes.h are C or C++
headers, not assembler ones so we don't need to have them individually
check that whether they're being compiled in assembler mode.
This removes the accidental leak of the qt_noop() declaration into
assembler and makes it clean:
$ cpp -P -D__ASSEMBLER__ -Iinclude include/QtCore/qglobal.h | grep -c .
0
(using grep because it prints four empty lines)
Change-Id: I69ecc04064514f939896fffd172e3fd6b6adc892
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise CI hangs if no existing browser can be reused (typical
case)
Fixes: QTBUG-109876
Change-Id: I63436a23c23c4b74c27c18effafde53bb6a4a34e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QCryptographicHashPrivate::SmallByteArray is a 65-byte type, so there
were 7 bytes of padding at the end of QCryptographicHashPrivate anyway.
Pick-to: 6.5
Change-Id: Ide4dbd0777a44ed0870efffd17394e1d5431e052
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QCryptographicHash::result() and resultView() are const, therefore two
threads can call them on the same object. Given that the finalization of
the hash is not a trivial operation but doesn't modify the state, let's
do it without a locked mutex, onto a temporary stack buffer. Then we lock
the mutex to copy said result to our cached value.
Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-110058
Change-Id: Ide4dbd0777a44ed0870efffd17394bf72785eabb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
So we don't have to do these reinterpret_cast everywhere, as most of the
APIs we're calling take unsigned chars themselves. The reinterpret_casts
will be removed in the next commit, which needs to modify those lines
anyway.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Ide4dbd0777a44ed0870efffd17394f9f25062122
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
AVX512FP16 expanded FP16 support on x86 to all operations (addition,
multiplication, comparison, etc.), so make use of them. Each operation
takes just as many cycles as an FP32 operation, but we avoid converting
between FP16 and PF32 for those operations.
Change-Id: Ide4dbd0777a44ed0870efffd17391370e1638c7a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This doesn't seem to be relevant anymore, and the
`from_lib_location_to_prefix` seems to be set correctly.
Change-Id: I368da226ed33a303662856b0bc3ccbf6c328250a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The new version uses PARSE_ARGV which deals with semicolons better.
Task-number: QTBUG-99238
Change-Id: Ie9276219400326a67ffa9cf5fc456ae7de0bbcd2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Conversion must be explicit from float, but doesn't need to be from int.
qimage.cpp:1915:33: error: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank [-Werror]
Pick-to: 6.5
Change-Id: Ide4dbd0777a44ed0870efffd17390a0e86f1fd7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Basically a convenience function for callers that don't need to specif a
state. Will be used in QDateTime in a later commit.
Change-Id: Ie4c516767195f681c89ed72e26653e75a262698c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Just describe the row instead. We'd lose the original input in case of
failure, so I added a class to print that value on destruction. Example:
FAIL! : tst_QAlgorithms::countLeading64(0) Compared values are not the
same
Actual (qCountLeadingZeroBits(value)): 63
Expected (expected) : 64
Loc: [tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp(374)]
QWARN : tst_QAlgorithms::countLeading64(0) Original value was 0x1
Pick-to: 6.4 6.5
Fixes: QTBUG-109958
Change-Id: I69ecc04064514f939896fffd1738b1119cd80cf8
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The QLocationPermission properties default to the least-intrusive
capabilities: Availability::WhenInUse (not: Always) and
Accuracy::Approximate (not: Precise).
Logically, QCalendar- and ContactPermission's readOnly property should
then default to read-only access, not read-write.
Orthogonally to this change of default value, it might make sense to
invert the name of the property, too: isReadWrite() or
hasWriteAccess().
Pick-to: 6.5
Change-Id: I9359c82051b1a6735feca8b2f06b9891acef650f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Non-polymorphic classes should not be exported wholesale, because MSVC
exports inline API in such classes, too, which has caused numerous
problems over the years.
Inline the last two remaining out-of-line functions, as they're
trivial.
Pick-to: 6.5
Change-Id: Ibc415b840b93a7350683e02433108270e1bd6bfd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To make space for a tst_qpermissions auto-test.
Pick-to: 6.5
Change-Id: Ic9ead8afa7ecd035fd5ed56c756f0156828c6705
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The focus is now to run autotests. The _qt_internal_test_expect_pass
tests will be handled at a later stage.
Fixes: QTBUG-109788
Change-Id: I8a5b5d8b793e5e22faf1876f3d05bc967dbcf777
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Avoid dangling or incorrect device pointer during handler
destruction. This was recently fixed in the destructors, fixed here
also for the setDevice() functions.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I85b64726cd88d2c8e63eee59d5b4f2ae488df61b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
qsizetype(int32 on 32bit, int64 on 64bit) vs uint32.
qxcbwindow.cpp: In member function 'virtual void QXcbWindow::setWindowIcon(const QIcon&)':
qxcbwindow.cpp:1300:30: warning: comparison of integer expressions of different signedness: 'qsizetype' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
1300 | if (icon_data.size() > xcb_get_maximum_request_length(xcb_connection())) {
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qxcbwindow.cpp:1301:53: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'qsizetype' {aka 'int'} [-Wformat=]
1301 | qWarning("Ignoring window icon: Size %llu exceeds maximum xcb request length %u.",
| ~~~^
| |
| long long unsigned int
| %u
1302 | icon_data.size(), xcb_get_maximum_request_length(xcb_connection()));
| ~~~~~~~~~~~~~~~~
| |
| qsizetype {aka int}
This amends ebdaf8ef9c.
Fixes: QTBUG-109610
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I2c9b5ad27881658463dd0870639c42d3ea8e7aba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Added a warning for when windeployqt is used with multiple binaries
which are in different directories.
Pick-to: 6.5
Change-Id: Ic43aa9847eb2bf6927cebf5d457595eed6b16b5a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This patch fixes four issues with Metal tessellation.
a) Shader resource binding
The Metal tessellation implementation assumes identical SPIRV-Cross
native Metal resource binding mapping for vertex, tessellation control,
and tessellation evaluation shaders. These mappings are independently
generated by SPIRV-Cross for each shader stage, and may not always be
identical. This patch allows for different resource bindings for each
of the vert/tesc/tese stages.
b) Tessellation evaluation vertex descriptors
The Metal tessellation evaluation render pipeline vertex descriptor
generation code contains a bug where attribute offsets and built in
variable locations could be calculated incorrectly if the tessellation
control shader output variables are not provided in ascending location
order. This patch fixes this by sorting the variables by location
before processing.
c) Render pass descriptor
Metal tessellation draw ends the current render pass encoder to perform
tessellation compute tasks on a compute pass encoder. When the compute
pass is completed, a new render pass encoder is created to continue
rendering. A bug exists where the new render pass encoder uses a render
pass descriptor that clears the color, depth and stencil attachements.
This patch fixes this bug by changing the render pass descriptor color,
depth and stencil attachment load actions to MTLLoadActionLoad when
appropriate.
d) drawIndexed
A bug exists where when drawIndexed is called, the Metal tessellation
vertex as compute stage input descriptor buffer layout step function
gets set to MTLStepFunctionThreadPositionInGridX rather than the indexed
version MTLStepFunctionThreadPositionInGridXIndexed. This patch fixes
this by selecting the appropriate step function.
Pick-to: 6.5
Change-Id: I122c67394719ad6b4801cd7643043839fd186bf2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This is unnecessary and basically doesn't have any effect.
Pick-to: 6.5
Change-Id: I6b63e989c43bdcd55bf83d2c0756da2de1ab49df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We decided that it's better to disable PkgConfig for Android, as it is
unlikely that someone uses them.
Task-number: QTBUG-110007
Pick-to: 6.5 6.4 6.3 6.2
Change-Id: I6ae1059ddd05feeec047fbb906c7dba1586e816b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Made it so that qml dependencies will be imported for all invoked
binaries, rather than just the first one.
Task-number: QTBUG-99125
Pick-to: 6.4
Change-Id: I0d97905c59281a03ef2126ae1c436f1034e1575d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
tst_qstringapisymmetry needs to use the same collation testability
criteria as tst_qcollator, that is, the locales that may be tested
without ICU and not on Mac nor Windows are only the system locale and
C locale.
Task-number: QTBUG-109954
Change-Id: I69f19ae28b3a16b3827c1eee62ae59fcfdf45209
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Mixed operations with QByteArrays trigger deprecation warnings. We
don't have a Latin1/UTF-8 mixed comparison, so simply unroll what
operator== did: convert the byte array to QString and then do the
conversion there. But do it better -- only once and not at every
operator== call.
Task-number: QTBUG-100234
Change-Id: I4c6a4b92e175c536f69debf822b10688588e6c6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is better for performance.
Switching to PMF connects would break some subclasses outside Qt
(like KExtraColumnsProxyModel) which need to disconnect some
internal connections,so it would require adding API to toggle
those things; too complicated for this small performance fix.
Change-Id: If89dbadc9cc84c94ca70b71cbc5afc267aebffd1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This reverts commit 4096667d66.
Reason for revert: <Screen shot workaround is flaky.>
Change-Id: I6e01cc584c094d0d0b8c1544b9daf72d648dd002
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
qcollator_posix.cpp is included if ICU is not used and the OS is not
Win nor macOS. Reflect that fact in tst_qcollator instead of using
alternative means which breaks with new platforms that use the
posix collator.
Task-number: QTBUG-109954
Change-Id: I592500ce9626efbcc9377cecf6641967f978c6da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are numerous conflicting symbols in the tst_qstringbuilder\d
variants when batching those together. Remove the linkage from symbols
by putting the common include stringbuilder.cpp in an unnamed
namespace.
Task-number: QTBUG-109954
Change-Id: Ic2a745795b57482c90c9def7667a1145cdb19854
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>