Commit Graph

59628 Commits

Author SHA1 Message Date
Antti Määttä
bab65d70dc Add find package for lttng library so that it gets added to target
Add it globally so that each module using tracepoints don't have to
add it themselves to each modules configure.cmake.

Pick-to: 6.5
Change-Id: Id58cfaff5cd715b2667da2470001d646117f9f28
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-13 12:43:45 +02:00
Antti Määttä
9bdf74a4f2 Add tracepointgen tool and convert qtgui to use it
Allows automatically generating tracepoint files by scanning source
files for instrumentation macros.

This makes it easier to add tracepoint support to modules and also
ensures that the tracepoint files do not get out of sync with the
functions they are tracing.

Q_TRACE_INSTRUMENT generates entry/exit tracespoints for a function
it is set. Q_TRACE_PARAM_REPLACE is used to change a function parameter
for these functions to convert it to supported parameter type.
Q_TRACE_POINT can be used to create a standalone tracepoint.
Q_TRACE_PREFIX can be used to add prefix for generated tracing backend
for example to add includes for types used in the trace points..

Task-number: QTBUG-107238
Pick-to: 6.5
Change-Id: Ib395b80838434ceb72683dac0545ca20c4d09455
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
2023-01-13 12:43:44 +02:00
Antti Määttä
f488c65721 Fix array handling in tracegen tool
Remove the array field type. We need to know the basic datatype as well
for future backends. Use the arrayLen instead. Add the missing array
handling for etw backend.

Task-number: QTBUG-106399
Pick-to: 6.5
Change-Id: I97c38240bd1c79c0e61d268a7d780016b341f110
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
2023-01-13 12:43:44 +02:00
Friedemann Kleint
135a792940 QtOpenGL: Disambiguate class name QTextureBinder
It occurs twice, causing a clash in CMake Unity (Jumbo) builds.

Task-number: QTBUG-109394
Pick-to: 6.5
Change-Id: I39341af72cfa406d80c598a56db9e02f80c61a9b
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-13 07:58:37 +01:00
Ulf Hermann
9615e7f9e5 Gui: Always declare qt_memfill{32|64} as function pointers on x86
Having the declaration of a function depend on compiler flags is a
fundamentally bad idea since you can compile different compilation units
that all include the header with different flags. This leads to
undefined symbols.

Pick-to: 6.5
Fixes: QTBUG-109159
Change-Id: I0aede280988e4f10c42d5b1824ad9c96a1e10854
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 20:54:22 +01:00
Jan Grulich
a48bbbaa50 QCryptographicHash: no need to store return values just to ignore them
There is no benefit from storing return value from some OpenSSL calls as
the only thing we do is to ignore them. There is also no difference when
we would be returning earlier.

Pick-to: 6.5
Change-Id: I76c742016a2532c65ffdcd913aafc74a2d1a9623
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-12 20:45:52 +01:00
Marc Mutz
def2a3de37 Move q20::remove_cvref to q20type_traits.h
The original is defined in <type_traits>, not <functional>.

Pick-to: 6.5
Change-Id: I596e56f64d2eed609ad2f7e6f03ae006afaa2fa9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 20:45:51 +01:00
Friedemann Kleint
c1e390f16c QtPrintSupport: Disambiguate static functions
They cause clashes in CMake Unity (Jumbo) builds.

Task-number: QTBUG-109394
Pick-to: 6.5
Change-Id: If3029d5b99499fd0e216fc080ade9842c2d11ea4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-01-12 20:16:28 +01:00
Ahmad Samir
56e42f1818 QNetworkDiskCache: optimize expire()
- Use a std::vector<struct> that has the needed info already cached
  (e.g. now size() isn't computed twice)
- Only sort the cache items if the size exceeds the cache limit and
  there are files to remove

Change-Id: I69a7a5d1afb26d156c4babddf6b357ec68d569d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-12 21:16:27 +02:00
Mikolaj Boc
51b1a23aa1 Inline the resetSystemLocale function
It's used from three different tests so it can only have one
definition, but when batching it has three of them.

Task-number: QTBUG-109954
Change-Id: Idfddd313a1fe447968066118529527e3d4214823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 19:54:13 +01:00
Marc Mutz
26b227e128 QVarLengthArray: Extract Method growBy()
Separates the actual reallocation use-cases from the resizing ones
when calling reallocate_impl, in preparation for fixing QTBUG-109745.

Task-number: QTBUG-109745
Pick-to: 6.5 6.4
Change-Id: Iee0c3e56569ec7877beda8db3a645e2bbb6b4d4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 19:54:13 +01:00
Marc Mutz
7c5ff43ea3 QVarLengthArray::resize_impl: don't default argument, overload
Separates the resize(n) and resize(n, v) code paths in preparation for
fixing QTBUG-109745.

Task-number: QTBUG-109745
Pick-to: 6.5 6.4
Change-Id: I49808ce4dc2f1de0de6af120990b2e00edb47728
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 19:54:12 +01:00
Friedemann Kleint
d9d74723cc QtSql: Disambiguate typedefs
They cause clashes in CMake Unity (Jumbo) builds.

Task-number: QTBUG-109394
Pick-to: 6.5 6.4 6.2
Change-Id: I3f94044671cdbd0a1bb0964bf291e36508223b50
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2023-01-12 19:03:17 +01:00
Edward Welbourne
73e7ffb2fd Verify land-preservation in locale construction
For most territories, if we specify only that territory, we should get
a locale specific to that territory. There are exceptions for various
reasons, but check that it's true in most cases, at least. In the
process, convert two QVERIFY(... == ...) into QCOMPARE(..., ...)

Task-number: QTBUG-64940
Change-Id: I7590f20f37b0b459aafb3d1d08f6eb77932fa027
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 19:03:17 +01:00
Edward Welbourne
c9d9a161aa Use the CLDR endonym in the documentation
Not sure where the docs got "Schwiizertüütsch" but it's not what CLDR
gives for Swiss-German's endonym.

Change-Id: I25d0aabea061ea34021311a2ec11d14ce61502d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-01-12 19:03:16 +01:00
Edward Welbourne
abac1e5d32 Don't std::move a trivially-copyable QTimeZone::ShortData
CodeChecker (clang-tidy) grumbles about it and it's pointless for a
trivially copyable type. So make the relevant constructors simply take
ShortData by value.

Change-Id: I49ea180df26c6fd56591f3f21a285b1f697352dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 19:03:16 +01:00
Edward Welbourne
f5437a9d58 Include tzInfo.StandardBias in getCurrentStandardUtcOffset()
It's usually zero, but in principle we should include it (when it's
not flagged to be ignored), see
https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/ns-timezoneapi-time_zone_information#members
https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-gettimezoneinformation
for details.

Task-number: QTBUG-109974
Change-Id: I8b6e0ea31a1cbd0e88f23ab01854e69258b0056b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 19:03:16 +01:00
Thomas Senyk
17a59f6613 Add QEGLContext::invalidateContext
QEGLContext::invalidateContext will mark that egl context is invalide
and trigger SceneGraph to destroy it, create a new one and re-create
and re-upload all resources (e.g. textures) associated with the current
state of the SceneGraph

In addition this change also improves
QEglFSWindow::invalidateSurface() and
QEglFSContext::eglSurfaceForPlatformSurface(..)

Where QEglFSWindow::invalidateSurface() will now destroy the
corresponding EGLSurface via eglDestroySurface, including "unbinding"
it from the current thread via eglMakeCurrent and
un-setting the screen's EGLSurface in case it's the same resource.

QEglFSContext::eglSurfaceForPlatformSurface(..) will now call
QEglFSWindow::resetSurface() in case of getting a EGL_NO_SURFACE
from the QEglFSWindow (which happens if above invalidateSurface()
was called before) - therefor re-creating the resource if
it was destoyed via QEglFSWindow::invalidateSurface()

Pick-to: 6.5
Change-Id: I37badd1fc11e993c395fb1502e9bd27ebe18b821
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-12 19:03:15 +01:00
Mikolaj Boc
8745a73c4f Remove the instance.ENV assignment in js test runner
The assignment crashes with 3.1.25 as instance.ENV is now a read-only
property. This used to be assigned to an empty object, so it was
useless anyway.

Change-Id: I47d4cd831052de514c372adb3f2202d8a0a6e06f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-01-12 17:14:11 +00:00
Friedemann Kleint
aa29b3ef52 Add missing header guards
Task-number: QTBUG-109394
Pick-to: 6.5 6.4 6.2
Change-Id: Idc5b0057d41186c8dfd7e752fe819ebebc6f8859
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-12 18:14:11 +01:00
Marc Mutz
1b6883146d Q{Contact,Calendar}Permission: rename isReadOnly → isReadWrite
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>
2023-01-12 18:14:10 +01:00
Marc Mutz
ceb4140b59 Q<Concrete>Permission: unexport classes
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>
2023-01-12 18:14:10 +01:00
Marc Mutz
49cdfb0c61 QPermission: add missing \since 6.5
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>
2023-01-12 18:14:10 +01:00
Jan Grulich
698c7696eb QCryptographicHash[OpenSSL]: allow to get intermediary result
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>
2023-01-12 16:33:56 +01:00
Joerg Bornemann
94e474b48e CMake: Add switch for allowing missing Qt6*Tools packages
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>
2023-01-12 16:33:55 +01:00
Edward Welbourne
9031574440 Make QDateTime::Data::CanBeSmall a static constexpr bool
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>
2023-01-12 15:47:34 +01:00
Mikolaj Boc
80686be086 Use the correct size argument for wcsxfrm
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>
2023-01-12 14:32:28 +01:00
Mate Barany
696ad54e5d [doc] Warn users about data races regarding qt_ntfs_permission_lookup
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>
2023-01-12 12:24:36 +01:00
Kai Köhne
1c62e821ba Doc: Show signatures of typedef's
qdoc doesn't do this by default.

Pick-to: 6.5
Change-Id: Idd4885be2fdac951b2ed555088f9b3f7989157ab
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-12 10:05:53 +01:00
Kai Köhne
cb534ec58f Doc: Document further GUI API as new in 6.5
Pick-to: 6.5
Change-Id: I83402aec120a2f6a78b245029b94d3519f94d7f3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-12 10:05:53 +01:00
Kai Köhne
fbf0c88d04 Doc: Mark new QGlyphRun methods as new in Qt 6.5
Pick-to: 6.5
Change-Id: I5e977a6c7e5356dcdca245f424abd920403c6a72
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-01-12 10:05:52 +01:00
Marc Mutz
a478d730f8 Add minimal QPermission auto-test
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>
2023-01-12 08:48:46 +01:00
Thiago Macieira
c66adaa1f1 tst_Selftests: rewrite this with templates instead of macro
Otherwise it's undebuggable.

Change-Id: I3c79b7e08fa346988dfefffd171ee81fefde63b0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-01-12 00:00:20 -07:00
Thiago Macieira
e9a9257828 Use the real qconfig.h in the bootstrapped config
We merely replace the QtCore bits now.

Change-Id: I76216ced393445a4ae2dfffd17297e31e23cca10
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-11 23:00:20 -08:00
Thiago Macieira
61935786c3 Move duplicated code between two headers to include qconfig.h
Change-Id: I76216ced393445a4ae2dfffd17297e2b059350d3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-11 23:00:19 -08:00
Ville Voutilainen
18def77d27 Fix dangling references
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>
2023-01-12 06:23:58 +00:00
Thiago Macieira
313720fef0 qglobal.h: centralize the __ASSEMBLER__ check
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>
2023-01-11 22:23:20 -08:00
Mikolaj Boc
1558153360 Kill the browser that CI on wasm opens for testing
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>
2023-01-12 04:34:34 +01:00
Ahmad Samir
f090a4785b QStringConverter: use qt_to_latin1() helper from qstring.cpp
This changes the newly-added QLatin1::convertFromUnicode() overload.

Change-Id: Ie465f052e711d72e51217b74b5b51a89c5d8b9e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-12 05:05:02 +02:00
Thiago Macieira
92a7c36020 QCryptographicHashPrivate: repack, by moving the enum to the end
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>
2023-01-11 17:38:07 -08:00
Thiago Macieira
ccad719d2e QCryptographicHash: add a mutex to writing to the results
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>
2023-01-11 17:38:07 -08:00
Thiago Macieira
2d7a27b918 QCryptographicHashPrivate: standardize on quint8
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>
2023-01-11 17:38:06 -08:00
Thiago Macieira
272d078926 QRgbaFloat: add support for multiplying & comparing as FP16
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>
2023-01-11 17:38:06 -08:00
Amir Masoud Abdol
59d5a52c22 Clean up an outdated TODO
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>
2023-01-11 22:58:59 +00:00
Amir Masoud Abdol
dc00369c56 Replace the impl of qt_configure_file with qt_configure_file_v2
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>
2023-01-11 22:24:47 +01:00
Mikolaj Boc
21bd782a69 Provide the proper QSysInfo::productType on WASM
Task-number: QTBUG-110057
Change-Id: I73b78e56faa3af858f60b884d0ea36acbd7f78cf
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-11 21:17:45 +01:00
Thiago Macieira
03b72188f4 QtGui: fix build with GCC 13's support for FP16
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>
2023-01-11 11:16:21 -08:00
Ahmad Samir
299f2a7a3f QStringConverter: add QLatin1::convertFromUnicode() overload
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>
2023-01-11 21:16:21 +02:00
Thiago Macieira
d0408b5f13 tst_QAlgorithms: don't use random numbers in the test row names
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>
2023-01-11 11:16:20 -08:00
Marc Mutz
fae85282ba Q{Calendar,Contact}Permission: invert default state of isReadOnly
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>
2023-01-11 19:36:27 +01:00