Commit Graph

55721 Commits

Author SHA1 Message Date
Alexey Edelev
ea30708972 Install QtCopyFileIfDifferent as the 'public' cmake helper
QtCopyFileIfDifferent needs to be both installed and copied to a build
folder as a public CMake helper. Otherwise it's not found when building
tests inside the Qt build tree.

Pick-to: 6.2 6.3
Fixes: QTBUG-101916
Change-Id: I8d081e594fe694f528ebac4c13bbdf6d3b8402b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-21 21:16:14 +01:00
Shawn Rutledge
f0254ef50c qsql_ibase: fix includes
QMap was a transitive include, apparently; and we have mostly
standardized on specifying the module where each include comes from.

Change-Id: I1a54db879e744120f5b10eb0b16f8ba36cde8300
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-21 20:41:23 +01:00
Ulf Hermann
908ee8aab1 QProperty: Allow manual scheduling of binding notification
In some situation we want to notify even if the value didn't change.

Task-number: QTBUG-101771
Pick-to: 6.2 6.3
Change-Id: I7d82a9f6e0f7d5eb48065e3f428b814939181ea8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-21 20:41:23 +01:00
Volker Hilsheimer
cbf8fc0ac4 Fix warning in tst_qfuture
Explicitly move the argument into the return value to silence:

qfuture_impl.h:153:20: warning: local variable 'arg' will be copied
despite being returned by name [-Wreturn-std-move]
            return arg;
                   ^~~

[...]
qfuture_impl.h:153:20: note: call 'std::move' explicitly to avoid copying

Change-Id: I49fab7c31efb7d809182c8d56e6a5ed8f05a5622
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-21 20:41:23 +01:00
Volker Hilsheimer
c924c05ae2 Replace deprecated QColor::fromString in tests and documentation
Don't use deprecated methods in tests, and don't refer to them in
documentation.

Change-Id: I110480742d9a7b9b0a2e194e3fe610208c1e07da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-21 20:41:23 +01:00
Volker Hilsheimer
4ac00ca901 QTabBar: let styles draw tab text with foreground role
QTabBar::setTabTextColor's documentation and implementation suggests
that the set color will always be used unless invalid, and that the
foreground role is used otherwise. QTabBar then sets the foregroundRole
palette entry to the specified color before calling the style. The intent
is evidently that the tabTextColor is used no matter the foregroundRole
(which by default is the role that contrasts with the background role).

If the styles always paint the text with WindowText, then the tabTextColor
gets ignored if the foregroundRole is not WindowText (perhaps because
the backgroundRole is set to Base).

Fix this by respecting the widget's foregroundRole when painting the tab
label in the common style (which is the only style that implements
drawControl for CE_TabBarTabLabel). QMacStyle and QStyleSheetStyle
need to be adjusted to prepare the palette consistently with the logic
in QTabBar.

Pick-to: 6.3 6.2
Fixes: QTBUG-101456
Change-Id: I077a2034eebfe3f56cea28917494f4db01e48747
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-03-21 19:41:23 +00:00
Øystein Heskestad
eaabd0c545 QAnyStringView: constexpr detect 8-bit ASCII as Latin 1
This has performance benefits when doing comparisons.
The check is only performed at compile time.

Task-number: QTBUG-101014
Change-Id: I55694b045fe5e75d9671d0a3a70c80d998cf98c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-21 20:36:23 +01:00
Janne Juntunen
64847af6e6 QtPlatformSupport: add support for detecting webOS
Some autotest CMakeLists.txts need to know whether the target is webOS.
This change enables that.

Task-number: QTBUG-101933
Pick-to: 6.3
Change-Id: I7b4ebe89622a4ad8bc313e807d9fa50152c96d14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-21 21:36:23 +02:00
Kai Köhne
5428c06958 Doc: Remove mentionings of overflows from QElapsedTimer
The last 32 timer that could overflow was not used anymore since Qt 5.9,
see also commit aaa3184f8d. This appends commit aaa3184f8d.

Pick-to: 6.3 6.2 5.15
Change-Id: If033a5fa7a58427bcbc643cc19fc73a8dd36a169
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-21 20:36:23 +01:00
Alexey Edelev
68c0e932a5 Unify DEPFILE support check
Add common function that unifies the check for the DEPFILE support.
Update the check according to the recent CMake version.

Task-number: QTBUG-99354
Change-Id: Ia2abf46fe3a9a3d17ea7a37eaf6c9c6a697c5b84
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-21 12:39:49 +01:00
Volker Hilsheimer
83e11b5fc4 Fix build with latest Apple clang version
Building with Apple clang 13.1.6.13160021 (from command line tools 13.3)
results in

qhash.cpp:754:39: error: passing 16-byte aligned argument to 32-byte
aligned parameter 3 of 'operator()' may result in an unaligned pointer
access [-Werror,-Walign-mismatch]

        hash2x32bytes(state0, state1, src, src + 1);
                                      ^

Help the compiler with deducing the right type for 'src' and 'srcend'.
Also makes 'src' const explicitly.

Change-Id: Id14a034f0fa4c2a002d9b37729d803a50a0e5e9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-21 06:34:25 +01:00
Rafael Roquetto
d15ef5bc3a QNX: always create buffers for child windows
The QNX raster backend worked on the assumption that child windows were
sharing their parent toplevel window buffer instead, and thus did not
have a buffer of their own. This piece of code dates back from the
BlackBerry days, and I am guessing the motivation was to tackle
mmrenderer/foreign windows.

In fact, not having buffers causes QWindow to malfunction, as
independent buffers are required.

This patch makes sure every QQnxWindow has a backing buffer, as
expected. Foreign widnows shall be dealt with via different means.

Change-Id: I059ac4f8ac684b3577048f874f82b866f21326b1
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2022-03-21 12:12:54 +10:00
Volker Hilsheimer
9d12f6adbc Fix warning from deprecated QMouseEvent constructor on macOS
Pass global position explicitly.

Pick-to: 6.3
Change-Id: I4b9bf735635528c4a289be7db6026162d5a7aff6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-03-21 02:33:27 +01:00
Volker Hilsheimer
f3466fad53 Build QMenuBar test without warning
Adapt to changes in QWidget::addAction API from 08e4d2db08.

Pick-to: 6.3
Change-Id: If6e05b47de88cf55070238f08b96586b855cc5c1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-20 23:19:03 +01:00
Volker Hilsheimer
75ea5a0335 Fix build on macOS without warning after QString::count deprecation
Pick-to: 6.3
Change-Id: Ie043289c258fadbfafaf4a88b9695f0e65699de8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-20 23:18:56 +01:00
Laszlo Agocs
b96c212360 Remove a now-unneeded QT_NO_OPENGL ifdef
This is from a fix unrelated to the recent rhi-based composition
work, which means it still had to enclose the block in an ifdef
due to the variables being only present in OpenGL-enabled builds.
Now with the other patches in place, the variables are no longer
conditional, and the similar ifndef QT_NO_OPENGL checks are already
gone pretty much everywhere so the ifdef is not needed here either.

Change-Id: I497c7a4fad7cd7d8fc1a479e7032de3e2cbb3b32
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-03-20 19:12:11 +01:00
Sona Kurazyan
d0f9e593d4 Rename tst_qlatin1string and switch to using QLatin1StringView
Task-number: QTBUG-98434
Change-Id: Iec477835880263175edbc03f21b40f1ad67dbef0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-19 18:51:08 +01:00
Sona Kurazyan
94addad4dd Add QLatin1StringView as an alias for QLatin1String
And switch to using QLatin1StringView for bootstrap builds and Qt 7.

[ChangeLog][QtCore] Added QLatin1StringView as an alias for
QLatin1String.

Task-number: QTBUG-98434
Change-Id: Iefb860b63eb05ef4755b2e26de265e6e6e4420b3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-19 18:51:00 +01:00
Marc Mutz
c839efb07a QtGui: compile-optimize inline swap functions
Instead of using the overly-generic qSwap() monster, use

- qt_ptr_swap() for swapping raw pointers
- member-swap for swapping smart pointers
- std::swap() for swapping scalars

In QtCore, this has proven to give a nice reduction in compile time
for Qt users, cf. b1b0c2970e.

Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I987ff95e8751a22a4f283655d8225dd16de21178
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-19 16:56:08 +01:00
Martin Storsjö
81fb9c5b14 qversiontagging: Fix the imp prefix for 32 bit arm
The underscore symbol prefix is only used on 32 bit x86, not on
other 32 bit architectures such as arm.

Change-Id: Iac82f2d70c8b0c811faa7af5b59805b388b0a00c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-19 16:12:57 +02:00
Alexandru Croitor
4b7225c662 CMake: Don't build the movie example if the feature is disabled
Pick-to: 6.2 6.3
Fixes: QTBUG-101897
Change-Id: Idef9aaa0c0a0380b88d8769cb19becd613b2173b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-03-19 14:19:13 +01:00
Marc Mutz
c52ebb3aba QRect: add toRectF()
For symmetry with QRectF::toRect().

[ChangeLog][QtCore][QRect] Added toRectF().

Fixes: QTBUG-73160
Change-Id: If2bda64b8fe4bc113191dda927e9bb86ebcb4c69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-19 12:02:24 +01:00
Marc Mutz
5dc570f8b1 QLine/QMargins: add toLineF/toMarginsF()
For symmetry with QLineF::toLine().

[ChangeLog][QtCore][QLine] Added toLineF().

[ChangeLog][QtCore][QMargins] Added toMarginsF().

Task-number: QTBUG-73160
Change-Id: I69051cdd2fe4a3c0a000ab86e363a2918a7aea7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-19 12:02:24 +01:00
Marc Mutz
2fb0135efa QSize/QPoint: add toSizeF/toPointF()
For symmetry with QSizeF::toSize().

[ChangeLog][QtCore][QSize] Added toSizeF().

[ChangeLog][QtCore][QPoint] Added toPointF().

Task-number: QTBUG-73160
Change-Id: I65b088b4f7365ab671ef2f0c75821b707f5ac26d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-19 12:02:24 +01:00
Marc Mutz
98cbdae527 QMargins: fix a missing "full stop" in the docs
Pick-to: 6.3 6.2 5.15
Change-Id: Ic8012ce12ef8d2fee2dc785e373e9c9d8f658ff5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-19 12:02:24 +01:00
Marc Mutz
f97daab7a6 QObject: restore flags printing in dumpObjectTree()
This was lost when QtCore, QtGui and QtWidgets were split up. Restored
now via a virtual function on QObjectPrivate.

Chose to return std::string instead of QString or QByteArray because
its SSO is usually sufficient to hold these flag strings.

[ChangeLog][QtCore][QObject] Restored printing of Qt3-style
information from dumpObjectTree().

[ChangeLog][QtWidgets][QWidget] Restored printing of Qt3-style
information from QWidget::dumpObjectTree().

Fixes: QTBUG-101732
Change-Id: I39ff5728ea5f5abbdbf81b5d7e13b8d16b6ee8b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-19 12:02:24 +01:00
Marc Mutz
6ec1dc904d QSettings: port key processing to QAnyStringView
... in preparation for replacing the QString keys in the public API
with QAnyStringView ones.

This removes the "important optimization" that avoids a detach in the
common case where the input is the same as the output of
normalization. But that optimization is beside the point, because it
trades a memory allocation avoided in the library for O(N) allocations
inserted into user code for each call to QSettings::value(), the vast
majority of which are calls with string literals.

With the public interface ported to QAnyStringView in the follow-up
patch, we can then internally optimize memory allocations _in a central
place_ (e.g. by returning std::u16string or QVarLengthArray<QChar> from
normalizeKey() instead of QString). But first we need to get rid of all
the unwarranted allocations in user code.

Change-Id: I45fc83d972c552a220c9c29508001d3f172e1162
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-19 07:09:55 +00:00
Thiago Macieira
03de9ff7ee QJsonValueConstRef: fix null pointer dereferences
Introduced in commit 705ea62f9e, but
apparently these constructors aren't used anywhere yet.

Change-Id: Ic30914a4448d4bc28974fffd16dc521ab49d3be4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-18 15:14:27 -07:00
Volker Hilsheimer
6492a9c877 Refactor: use lambdas for visitor pattern in QGraphicsSceneBspTree
This way, the visitor implementations are directly where they are used,
without the need for a virtual function call. The allocation of the
visitors on the heap was anyway overkill (they could just have been
allocated on the stack where they were used).

Change-Id: Ic41fd285e3a45daaf2e17aa5aeee07e754127a00
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-03-18 21:56:19 +01:00
Volker Hilsheimer
5e566ab373 When clearing selected items, iterate over a copy of the QSet
Selection change handlers of the items might call a method that
implicitly recreates the selectedItems QSet, which then invalidates
the iterators of the ranged for loop, resulting in crashes.

Iterate over a copy of the set instead.

Add a test case that crashen without the fix.

Fixes: QTBUG-101651
Pick-to: 6.3 6.2
Change-Id: I6da6f4043fe1906b0186931a37283f635cb5a404
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-03-18 21:56:19 +01:00
Luca Di Sera
33d62de7c8 Enable move semantics for QTemporaryDir
Add move constructor and move assignment operator.

To allow for the the change to be implemented QTemporaryDir, the
internal d_ptr was modified from a QScopedPointer, which is not movable,
to a raw pointer.

Add member + free swap implementations.

Add tests.

[ChangeLog][QtCore][QTemporaryDir] Enabled move semantics.

Change-Id: I9f196a77c70b4ca0b7f0c06505d00fdd87a9785c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-18 20:56:19 +00:00
Tor Arne Vestbø
e14466aa66 Fix -Wunused-but-set-variable in QTcpSocket documentation snippet
Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-101883
Change-Id: I54dc7229565cef199f306a0ac837a932aeb00ec6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-18 19:47:59 +01:00
Tor Arne Vestbø
bdb9a254c2 macOS: Remove dead code for focus ring handling in Mac style
It was added in 375dd7ad34
but never used.

Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-101883
Change-Id: Ibad7e0b1c371bdee63bcdbea0c5280091107408a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-18 19:47:59 +01:00
Mårten Nordheim
82296d3193 Add missing includes for some of our _win.cpp files
Change-Id: I74067f5d50bea6fbc16576c26bf84f91e449e497
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-18 17:35:03 +00:00
Ivan Solovev
30830e0cba Android: use empty Intent to clear clipboard data on API < 28
ClipboardManager didn't have any APIs to clear clipboard data before
API level 28.
As a workaround an empty Intent with MIMETYPE_UNKNOWN is created and
inserted into the clipboard for lower API levels.
This makes the QApplication::clipboard()->clear() method work more or
less as expected.
This allows to unblacklist tst_QPlainTextEdit::copyAvailable().

Task-number: QTBUG-87423
Task-number: QTBUG-89402
Pick-to: 6.3 6.2
Change-Id: I454376199cf3b8eed0fa2ecf2f85b87f40892280
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-18 18:35:03 +01:00
Marc Mutz
9985cc330a uic: use C string literals for setObjectName()
Because setObjectName() now takes a QAnyStringView, passing C string
literals is much more efficient than using QString::fromUtf8().

This patch only deals with setObjectName() as a known property,
probably from a name attribute. If the objectName property is set by a
<property> element (or so I assume), we still emit a
QString::fromUtf8(). Detecting objectName there would be too much
magic.

Besides, I haven't been able to find why sometimes there's a second
setObjectName call right after the first, when in the XML it seems all
kosher (name attribute and objectName <property> agreeing on the
content).

Change-Id: Icf07bad841ac735a9c744bbd955428ba15758089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-18 18:35:03 +01:00
Fabian Kosmale
fa13e35ce4 cmake: only use qtbase configuration in qtbase
In a toplevel build, we include qtbase's .cmake.conf twice: Once for
qtbase itself, but already earlier to provide some necessary information
for the toplevel build. We now detect the latter, and skip setting
QT_EXTRA_INTERNAL_TARGET_DEFINES in that case, to ensure that it is only
applied to the qtbase itself

Task-number: QTBUG-101640
Pick-to: 6.2 6.3
Change-Id: I14dbf6110c79331fac38cceb76f669ca329ad33a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-18 12:33:10 +01:00
Giuseppe D'Angelo
fb7e9bef8d QMutexLocker: code tidies
Improve the docs for the recently added move operations.

Change-Id: Iae17f5289d30faab4aaaec14a27036f7a03129ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-18 12:32:28 +01:00
Janne Juntunen
a5ee74754d tst_qopengl: set surfaceType explicitly
Parent window in sizeLessWindow test was using software pipeline at
least on webOS, causing a QCRITICAL() exit when the test was executed.

Fixes: QTBUG-101869
Pick-to: 6.3
Change-Id: Ie8cc0ea0b6a09729475389be44197e01a45b217f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-03-18 13:02:11 +02:00
Alexandru Croitor
b858704e1f CMake: Mitigate moc not finding correct headers in framework builds
When CMake generates compilation rules, it extracts the values from
INTERFACE_INCLUDE_DIRECTORIES and checks if any of the values
are framework paths.
If they are, instead of adding an -I ./lib/My.framework to the
compilation rules, it adds -iframework ./lib or -F ./lib.

The same transformation does not happen when AUTOMOC passes include
paths to moc, nor during a headersclean check. The values there
are passed verbatim, with an -I prepended.

This causes issues when the include file name is the same as the
framework name.
E.g. #include <QtQml> + -I ./lib/QtQml.framework because moc
then ends up silently including the shared library
 ./lib/QtQml.framework/QtQml
instead of the header
 ./lib/QtQml.framework/Headers/QtQml

This can lead to a variety of silent issues during moc generation,
because all the definitions of QtQml will be missing.

Unfortunately, there does not seem to be a clean way to fix this in
the build system due to CMake semantics.
See https://gitlab.kitware.com/cmake/cmake/-/issues/23337 for details.

We can mitigate the issue by ensuring that
 -I ./lib/QtQml.framework/Headers
comes before
 -I ./lib/QtQml.framework

by manipulating the order of values in INTERFACE_INCLUDE_DIRECTORIES.

We might want to consider implementing an additional mitigation in
AUTOMOC, so that it filters out include paths like
 -I ./lib/QtQml.framework, thus ensuring that a newer CMake version
will not exhibit the same issue when used with an older Qt.

We could consider doing the same in moc. The advantage of doing it
in moc is that that moc will consider fewer invalid include paths
when searching for headers.

Amends 4b2de41b13
Amends d7efb2a419

Pick-to: 6.2 6.3
Fixes: QTBUG-89545
Fixes: QTBUG-101718
Fixes: QTBUG-101775
Change-Id: Ib2c25b5744bd2b5c9c83813bb04ad88c0179f6ec
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-18 08:08:52 +01:00
Mårten Nordheim
71edd2e4d8 Bump QT_DEPRECATED_WARNINGS_SINCE
When building Qt we should have warnings of any internal use
of deprecated API, so set it to Qt7.
Also added comments to clarify what the macros do.

Change-Id: Ib47278fed9ab1ec4411ed9f69a9a9c0f811db02d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-18 07:00:30 +01:00
Marc Mutz
7ed5b52e80 QMetaType: remove an unused static pointer variable
Unlike the Gui and Widgets pointers, the Core one wasn't needed,
because the only user can inline the variables contents.

Saves one relocation.

Pick-to: 6.3
Change-Id: Ib7535e1a29c5125eea55c66dad6d2d1de72f6bc1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-18 06:57:10 +01:00
Giuseppe D'Angelo
1b14569753 QMutexLocker: strenghten the locking operations
There is no reason to allow relock() on a locked locker, or unlock()
or an unlocked one, just like we don't allow that on a plain mutex
to begin with. The docs already said that e.g. relock() locks an
_unlocked_ locker.

[ChangeLog][QtCore][QMutexLocker] QMutexLocker allowed relock() and
unlock() on an already closed (resp. open) locker object. These
semantics have always been undocumented and are now unsupported
(in both cases they yield undefined behavior.)

Change-Id: Id5f67beb5dc30d6435dae88a3085fba93ec7d96e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-18 05:18:28 +01:00
Alexandru Croitor
9ec05e4f36 iOS: Use python3 for enumerating test target devices
macOS 12.3 removed python 2

Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-101745
Change-Id: Ieace2623e838cf36a7a68186b0f729ff0f19299a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-18 02:47:57 +00:00
Albert Astals Cid
6e23fc8580 QImage::operator==: Also compare the image colorspace
Pick-to: 6.3 6.2
Change-Id: I4cb86d32492876791fe852f8c3123b7d4a69a5bd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-18 01:32:57 +01:00
Edward Welbourne
e10d613509 Add QByteArray::percentDecoded() as an instance method
Percent-decoding was previously only present as a static method taking
a QBA parameter; it might as well be an instance method of that
parameter. Change most QBA tests to use it rather the static method.

[ChangeLog][QtCore][QByteArray] percentDecoded() is now available as
an instance method of the byte array to be decoded, equivalent to the
static QByteArray::fromPercentEncoding().

Change-Id: I982101c44bdac5cc4041e85598d52ac101d38fa1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-18 01:22:54 +01:00
Edward Welbourne
e0206fe9d4 Get rid of QByteArray::nulTerminated()
It is private and was not called by anything inline, even in 5.15, so
can safely be removed without causing binary incompatibilities, now
that it is no longer used even out-of-line.

Task-number: QTBUG-74286
Change-Id: Iaec3877079746bd9ba7d1a39efbfb2711e7c00a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-18 01:22:54 +01:00
Edward Welbourne
0cee66048d Tidy up QByteArray::toPercentEncoding()
After inlining the local static void to which it used to delegate most
of the work, the main loop can access *this and we have no need for
yet another copy of it or the variables to iterate it. We can also
access the result array directly, rather than via a (poorly-named)
pointer.

It turns out that wrapping QBA in QBAV each time we call a lambda on
it costs enough to cause a 50% slowdown, so change the lambda to now
take the const refs we have. (Constructing the views only once is as
good, for reference.)

Change-Id: I81c5996d91415d8a933de714177a89462555ff03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-18 01:22:54 +01:00
Sona Kurazyan
73e7fc2d8e Fix a few more {QString, QByteArray}::count() deprecation warnings
Change-Id: I0be2d5e7a8f6af3bc1077ae6d1f20cc5da8f2266
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-17 21:03:08 +01:00
Alexey Edelev
aec6b00758 Disable init prioritization in QNX
This fixes issue with non working QHash when loading QML plugins in QNX.

Change-Id: I55c9edc58aa27cff694603e6281c980e1fedbeba
Taks-number: QTBUG-101341
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 19:43:29 +01:00