Commit Graph

50771 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
37e0953613 QHash: add a Qt 7 TODO
The hashing seed's type has been changed from int to size_t in Qt 6.
However the functions setting/getting the seed, and the seed itself,
are still simply int, meaning that we've crippled our seeding.
Add a TODO to amend it.

Change-Id: Ie9dd177149ec299ccf16d4e31f9f4b065804cfed
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-03-21 10:16:28 +01:00
Andy Shaw
58437836f0 Merge "SQLite: Update to 3.35.2" 2021-03-20 12:50:27 +00:00
Andy Shaw
022fd8e79c SQLite: Update to 3.35.2
[ChangeLog][QtSQL][SQLite] Updated SQLite to v3.35.2

Pick-to: 6.1 6.0 5.15 5.12
Change-Id: I1e784627d7ed3a226acfbb28d8379d4c69f91a84
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-20 11:41:24 +01:00
Fabian Kosmale
411ab34c96 QMetaObjectBuilder: remove unused serialization code
Change-Id: I73a13265a69079581d2974400b3311d3fdfda2d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-20 10:24:27 +01:00
Alexandru Croitor
90fd142b09 Merge "CMake: Get rid of the Core_versiontagging object library" 2021-03-19 22:55:51 +00:00
Alexandru Croitor
d68486547a CMake: Get rid of the Core_versiontagging object library
We don't currently handle object libraries when creating prl files for
static Qt builds, so it's best to compile files as part of the main
Core target.

Use source file COMPILE_OPTIONS to add the -fno-lto flag to the
global/qversiontagging.cpp source file.

Amends 2d4a40f93f

Pick-to: 6.1 6.0
Change-Id: Iac1d37ecb4caa7c9889d44b3a103a9bdafec49f3
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-19 21:42:15 +01:00
Niclas Rosenvik
83e222d8ca Properly set ICC and QCC
Using CMAKE_C_COMPILER to match the compiler
has its drawbacks. CMAKE_C_COMPILER can include
the whole path to the compiler and directory
names that incude icc, icl or qcc also match
even if the compiler is not icc or qcc.
Icc has the compiler id Intel according to
the CMake documentation.
The compiler id for qcc is QCC according to
CMake policy 0047, and this is set to new since
Qt requires CMake to be above 3.0.

Change-Id: Iceb428ed10f0f5bbaa19ec2d883da186c85e7a73
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-19 21:02:23 +01:00
Niclas Rosenvik
e9e3c09f4b Merge "Set QT_DEFAULT_MKSPEC for various bsd systems" 2021-03-19 18:56:25 +00:00
Timur Pocheptsov
f6a603f0f5 Merge "Suppress warning (MSVC, C4250)" 2021-03-19 18:49:15 +00:00
Eirik Aavitsland
ac175ff483 Merge "paintengine: improve error handling" 2021-03-19 18:09:23 +00:00
Tor Arne Vestbø
e415939abf Merge "qmake: Improve error message when detecting macOS platform SDK upgrade" 2021-03-19 17:22:04 +00:00
Niclas Rosenvik
36a366c871 Set QT_DEFAULT_MKSPEC for various bsd systems
Set QT_DEFAULT_MKSPEC for various bsd systems, this is needed to
find qplatformdefs.h when compiling.

Change-Id: I9450193b737930548f32c87be3525c5ecd1e0e13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-19 16:47:03 +00:00
Timur Pocheptsov
a9300f2c34 Suppress warning (MSVC, C4250)
This design decision was intentional and reflects the fact that we
cannot have inheritance tree 'linear' as before, since the base
interface is an abstract class without any data-members.
Also, fix a warning about size_t -> int implicit conversion.

Fixes: QTBUG-91866
Change-Id: Icbc73c22d8adf72bbd8949125d4404ea6da69c6d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1a7faeef94dcf6826c6ee564a1bfb31ebb952e56)
2021-03-19 17:32:59 +01:00
Fabian Kosmale
919425cb3a Merge "tst_bench_qmetaobject: Fix test" 2021-03-19 15:52:31 +00:00
Eirik Aavitsland
e08eaf2c10 paintengine: improve error handling
Just check for null image/oom initially, no need to do it for every
scanline.
Reported by static analysis.

Change-Id: I86c3f09556b99b889e720901a3691bb0f730ac02
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-19 16:47:49 +01:00
Volker Hilsheimer
8f2f70a8ff Merge "Consistently check for nullptr in QGraphicsTextItem::inputMethodQuery" 2021-03-19 15:46:17 +00:00
Alexandru Croitor
ea5cc229e2 Merge "CMake: Make Platform a dependency for all Qt internal targets" 2021-03-19 15:12:33 +00:00
Tor Arne Vestbø
fca543bcde qmake: Improve error message when detecting macOS platform SDK upgrade
Pick-to: 6.1 6.0 5.15
Task-number: QTBUG-85546
Change-Id: I2bce9d22ad826fa73fa4dbfd03c9b1d404c57859
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-19 15:08:46 +00:00
hjk
b38b9e2bb0 Merge "Tests: Clarify the course of actions when touching tst_toolsupport" 2021-03-19 14:35:26 +00:00
Fabian Kosmale
ed3df88846 tst_bench_qmetaobject: Fix test
The code has apparently been broken for quite a while, probably since
the change that made the QObject constructor invokable.

Fixes: QTBUG-91710
Pick-to: 6.0 6.1 5.15
Change-Id: I8b7e6c8a579913b3d0e2a364ffdbffe8d404c72b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-19 14:37:51 +01:00
Volker Hilsheimer
7edf0fbb9e Consistently check for nullptr in QGraphicsTextItem::inputMethodQuery
If dd->control is nullptr, then it's nullptr all the way, so don't
dereference it in the calls to dd->controlOffset.

Fixes static analyzer warning 9c33d9bc9b8cf438dccb63aa52afcbe0.

Pick-to: 6.1 6.0 5.15
Change-Id: I7a61b6438422373678d4fcb66255b750c550724d
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-03-19 14:26:03 +01:00
Laszlo Agocs
98e4652a96 Merge "rhi: Make it possible to clone a QRhiRenderPassDescriptor" 2021-03-19 13:05:37 +00:00
Alexandru Croitor
d962c9ff85 CMake: Make Platform a dependency for all Qt internal targets
In particular that influences BundledLibrary targets.

Most internal targets already depended transitively on Qt::Platform
via Qt::Core as a public dependency. This was not the case for
BundledLibrary targets which don't link to Qt::Core.

This led to compilation issues in user projects when targeting
WebAssembly, due to mismatched flags between a bundled Harfbuzz vs
a user project. Probably other subtle issues as well (e.g. none of the
Windows specific compile definitions were passed to bundled libs).

Bundled libraries depend on PlatformCommonInternal already, so make
PlatformCommonInternal turn depend on the public Platform target.
I thought that was already the case, but we merely relied on the
Qt::Core dependency.

Note that Qt::Core should still list Platform as a public dependency,
so it gets propagated to user projects.

Amends acf9b3a68b

Change-Id: Ida3b219818f89ec6eba2c2d92c5db65ad56bc5a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-19 12:52:49 +00:00
Fan PengCheng
57c737f325 Merge "Improve the sample code" 2021-03-19 12:10:46 +00:00
hjk
8b5561c7ee Tests: Clarify the course of actions when touching tst_toolsupport
Change-Id: Ifc9caa8f1b05cd642c1bb57b0f37866de97ca2c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-19 13:07:03 +01:00
Laszlo Agocs
19384f2e8f rhi: Make it possible to clone a QRhiRenderPassDescriptor
Pick-to: 6.1
Task-number: QTBUG-91888
Change-Id: Ib6d2e639e6c24f3e9a733c6563dc8a6d6da47719
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-19 10:46:23 +00:00
Fan PengCheng
7b62b846ae Improve the sample code
maybe you forgot this line

Change-Id: I1f5abd08023bd344e5bb2bf811b6195cbcf61dff
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-03-19 17:54:34 +08:00
Christian Ehrlicher
e4bd73dc54 QSql/MariaDB/MySQL: use utf-8 as encoding for username and password
The mariadb driver sets the encoding for the connection to utf-8 but
only after the username and password was already set. Therefore
non-ascii characters were not correctly encoded when the local character
set was not the default one from the database.
Move mysql_set_character_set() above the username/password setting and
encode all as utf-8 instead local8Bit.

Fixes: QTBUG-55444
Change-Id: Iff7ee24159d54b578cd854e620aa814d72da3801
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-03-19 09:11:38 +00:00
Thiago Macieira
969337bcfd QHostAddress: prepare moving NetworkLayerProtocol from QAbstractSocket
This can only be completed in Qt 7, due to BC guarantees. I've only
updated the source code for QHostAddress and its unit test and even then
I did not touch the documentation. This needs to be completed in Qt 7.0

Change-Id: I26b8286f61534f88b649fffd166b695882f8f3b5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-18 19:54:01 -08:00
Thiago Macieira
8614491aa1 QAbstractSocket: fake a bind(QHostAddress::SpecialAddress)
Because this is misleading:

  socket.bind(QHostAddress::AnyIPv4);

The conversion of enum to int has preference over the construction of
QHostAddress from enum, so that ends up calling bind(6), which attempts
to bind to privileged port 6 and just returns with error. Meanwhile,

  socket.bind(QHostAddress::AnyIPv4, 0);

does construct the QHostAddress because that is preferred to converting
the int to the BindMode enum.

Ideally we'd simply add the overload to QAbstractSocket but we can't do
that because QHostAddress depends on QAbstractSocket. So I've added a
Qt7 task to invert that dependency.

Change-Id: I26b8286f61534f88b649fffd166b683266597796
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-18 19:53:56 -08:00
Volker Hilsheimer
180f78d126 QDial: use qRound to round
The calculation rounds early and often, which is intentional. Add
unit test to make sure we don't regress.

Fixes static analzyer report about incorrect rounding in
c903a34347776fe3b89785faa35c446d.

Address some outdated comments and documentation. The property
is read only and calculated, so don't imply that it can be changed
from its default value.

Change-Id: If2dbd9890e533dfccda3eae4cbc96db4f1246f4d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-18 22:34:13 +01:00
Robert Löhning
2b9bc46670 Merge "QAsn1Element: Avoid overflow in QAsn1Element::toInteger" 2021-03-18 21:04:48 +00:00
Eirik Aavitsland
6194b2e58a Merge "Triangulator: Ensure all members are initialized" 2021-03-18 20:38:55 +00:00
Robert Löhning
11a3eab1e1 QAsn1Element: Avoid overflow in QAsn1Element::toInteger
Fixes oss-fuzz issue 29534.

Pick-to: 5.15 6.0 6.1
Change-Id: I51d0b8238c73e5860c40d3b74577ddb8926647a3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-18 17:00:33 +01:00
Eirik Aavitsland
1cbd5fbf74 Triangulator: Ensure all members are initialized
Increases robustness and fixes a number of static analysis reports.

Change-Id: I2062e3fbb69a78831ef8c937e36cb318abf3529e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-18 16:26:42 +01:00
Edward Welbourne
b6544dc36c QTzTimeZonePrivate: provide correct data for before the first transition
We previously used the data for after the first transition; but the
Olson database knows about local mean time for each zone, and it does
get used by the system libraries, so systemZone will conflict with
LocalTime once we use the time_t functions outside their 32-bit range
(coming shortly). Record the pre-zone data during parsing and use it
in the (fortunately only one) place that needs it.

Discovered the issue in the course of debugging other issues while
purging QDateTime of its wilful ignorance of pre-1970 DST.

Change-Id: Icf957460fa3ccbaf5165e79f38ac68b450ecf98f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-18 15:31:06 +01:00
Edward Welbourne
9d3a7c72ad Extend system zone test to check it matches LocalTime
Test we get the same starts of various days. Some coming changes shall
break some of these, but they should all be back to working by the
time we're taking account of DST before 1970 as well as after.

The first two or three test-cases work by accident in most zones, at
present, due to the zone-based code-path ignoring the LMT period
before the zone's first transition; but Europe/Helsinki had a renaming
transition in 1878, so does see its pre-zone offset between then and
the switch to UTC+2 in 1921, leading to failures in exactly the zone
Coin tests.  So suppress these three test-cases pending later fixes.
On Windows, the next text (still pre-epoch) gets bogus zone data for
its LocalTime, so suppress that likewise.

Task-number: QTBUG-80421
Change-Id: I2264e0e436d92112b03264faa410e30057b8f73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-18 15:30:48 +01:00
Volker Hilsheimer
eb3395328a Merge "Don't combine enum values from different enum types" 2021-03-18 13:52:55 +00:00
Andreas Buhr
8ae3191757 Merge "Add documentation on how to write a value to a bindable property" 2021-03-18 13:40:36 +00:00
Laszlo Agocs
e933df8ce4 Merge "rhi: Make unreleased resource warnings available in release builds" 2021-03-18 11:55:43 +00:00
Andy Shaw
4c6949d655 Merge "macOS: Don't draw scrollbar handle when there is no range" 2021-03-18 11:18:00 +00:00
Andreas Buhr
48a77e0961 Add documentation on how to write a value to a bindable property
Writing a value to a bindable property is a surprisingly dangerous
operation. This patch adds a section to the documentation
describing the pitfalls which exist when writing bindable properties.

Task-number: QTBUG-90511
Change-Id: I73fea40756a1495d272bc46a7a51776ebcb07ea7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-18 11:53:18 +01:00
Volker Hilsheimer
20639d565b Don't combine enum values from different enum types
Address static analyzer warning dceb66e05690ed1fb2f1455a9eb517f6.

C++20 is deprecating arithmetic operations between unrelated enumeration
types, and not all of the enums involved here are clearly bitmasks.

Pick-to: 6.1
Change-Id: I61c9dcdc42ccd2b01a6208e067d216107672cc4d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-18 11:46:02 +01:00
Andrei Golubev
f49c6a5672 Merge "Rename QList test to something meaningful" 2021-03-18 10:10:23 +00:00
Timur Pocheptsov
e684d81867 Merge "Stop using QSslConfigurationPrivate inside the plugin code" 2021-03-18 09:39:49 +00:00
Laszlo Agocs
8a0dd61911 rhi: Make unreleased resource warnings available in release builds
...but tie to an environment variable still.

When destroying a QRhi object, it has the ability to print warnings for
each QRhiResource that got created from the QRhi and is still alive.
This includes only QRhiResources that own native objects underneath.

It can be handy to enable this in release builds as well. Therefore,
make this possible by setting QT_RHI_LEAK_CHECK=1. In debug builds this
continues to be always on.

Pick-to: 6.1
Change-Id: I5283676594284fadf2adf4f123b4fc6adb6db1f7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-18 10:05:47 +01:00
Andy Shaw
aac33296e6 macOS: Don't draw scrollbar handle when there is no range
If the minimum and maximum is set to be the same then we should not
draw the handle. An empty groove should be shown instead.

Pick-to: 6.1 6.0 5.15
Change-Id: Ie79f55cd761f9a8f614967c40c23a7f59e700a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-18 08:35:54 +00:00
Andrei Golubev
a2b362f2db Rename QList test to something meaningful
qtbug_xxxxx is a fairly ambiguous test name

Change-Id: I4b407160464c9b8300d3683549b0ede837161e7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-18 08:31:38 +01:00
Timur Pocheptsov
b4f3c5d646 Stop using QSslConfigurationPrivate inside the plugin code
It was reasonable while backends were a part of QtNetwork.
Now if moving them outside (or just trying to implement
a new backend as a plugin), accessing data-members of
QSslConfigurationPrivate means that any plugin knows
about memory layout actual only for the version of Qt
it was built with/for. Instead, we have to use the
public class. Since it does not have all needed setters
and some data-members have no access at all, we
provide an API in QTlsBackend (which stays a part
of QtNetwork) that knows the actual memory layout.

Task-number: QTBUG-65922
Change-Id: I5ca1de4f982b4b11d9a87c4b40413367dcb83c16
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 31cc0df7607a4d5887812c304aac0001c2cd7705)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-18 07:10:51 +00:00
Eskil Abrahamsen Blomfeldt
d860aaa200 Disable two tests in tst_QAccessibility on Wayland
These two tests (applicationTest() and mainWindowTest())
require QApplication::setActiveWindow() to work, which it
does not on Wayland.

Task-number: QTBUG-91418
Change-Id: I0e7b4e24050684b437de63d19bd885bab53d36b9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2021-03-18 07:58:42 +01:00