Commit Graph

50044 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
fdc7eb80dd Add QPlatformScreen::colorSpace()
Added for macOS and X11 screens

Task-number: QTBUG-90535
Change-Id: Ifafe7a07ee2abc3c42cd12785db2d7329878375b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-25 17:21:54 +01:00
Christian Ehrlicher
4e2a942369 QSql/PostgreSQL: allow blobs with more than 2^30 bytes
Due to limitations of QByteArray it was not possible to store more than
2^31 bytes. This was fixed in Qt6 so throw away the casts to int in the
postgres plugin

Fixes: QTBUG-79059
Change-Id: I8ae7276a04d4936bcf5ba6c413e3412f6c342ff5
Pick-to: 6.0
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-01-25 16:37:25 +01:00
Eskil Abrahamsen Blomfeldt
d79a9b1a4f Implement vertical subpixel positioning where available
For some use cases, vertical subpixel positioning may be
useful, as it allows you to vertically align text with
other painting primitives. This does impose an overhead,
so we make it opt-int with a render hint on the painter.

Note that this is only supported on Freetype currently.
It might be possible to support on older macOS versions,
prior to Mojave (which has disabled subpixel positioning
entirely), but since it would have limited usefulness
and Freetype is cross-platform anyway, I skipped that.

Note: This drive-by-fixes an issue with subpixel
positioning where glyphs would always be offset by 1/64,
because we added the aliasing offset *after* we had
determined the closest subpixel position. The idea of
this, as far as I can understand, is rather to snap to
nearest subpixel position upwards, not to add an offset
to all glyphs, so it should be added before finding the
correct position. It had a subtle visual effect when
animating the position. It might be that we could get
rid of it entirely, as I haven't been able to reproduce
any issues with that, but I have moved it instead, to
match what I believe the intention was.

[ChangeLog][QtGui][Text] Added render hint flag
QPainter::VerticalSubpixelPositioning which will position
text at subpixel positions vertically whenever supported.
In absence of this, text position will be rounded
vertically as before.

Fixes: QTBUG-35682
Change-Id: I8ce7a72a64e5a0924dac7c244e3e07c2938bfd09
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-01-25 15:56:50 +01:00
Kevin Funk
80e87ca05c dbus: Fix missing QVersionNumber include
Fixes the build

Change-Id: Ie0b7a1476bb1f80ee2ccfe1cbc6ca37e9c93e758
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-25 12:09:17 +01:00
Kimmo Ollila
77cfbd755a Add correct prefix for GHS compiler
This fixes INTEGRITY build error:

cannot access position 53 in array of 49 elements
          constexpr const char *begin = func + prefix;

and many "expression must have a constant value" errors.

Change-Id: I0e043028fbcb479c6657b59ea144b4536cc65651
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-25 08:37:06 +02:00
Christian Ehrlicher
1a9095e1fa QComboBox/Fusion style: elide text when it's too long
The fusion style did not elide a very long text in a QComboBox as it's
done in other styles / non-popup mode.

Fixes: QTBUG-86632
Pick-to: 6.0 5.15
Change-Id: I356a61809220d41717a9039d2b33dd706d034941
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-23 15:03:36 +00:00
Joerg Bornemann
1ef5016bab Fix QMAKE_PRL_LIBS entries on Windows for modules from other repos
When building a repository != qtbase, like qtactiveqt, QMAKE_PRL_LIBS
contained entries like Qt6Core and Qt6Widgets, meaning the linker line
would contain exactly these arguments.

When building an activeqt example with qmake, the link then failed with
"LNK1181: cannot open input file 'Qt6Widgets.obj'".

The correct entry would have been $$[QT_INSTALL_LIBS]/Qt6Widgets.obj.

Fix this by determining the full path to the import library in the first
step of the prl generation. This enables QtFinishPrlFile.cmake to
recognize Qt6Widgets as Qt module and generate the right QMAKE_PRL_LIBS
entry.

Pick-to: 6.0
Fixes: QTBUG-90520
Change-Id: Id0d9178da0e0dfc3ea4fadbbe8f5900d792ffc84
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-22 18:24:06 +00:00
Joerg Bornemann
88e24e6a25 Remove the QT_CMAKE_BUILD preprocessor define
Qt is now always built with CMake.

The "cmake" keyword for QtTest blacklists remains for now. Removal is
tracked in QTBUG-90545.

Change-Id: I0011d56176a07c82698b2eb9aa330e77efa6cd34
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-22 19:22:15 +01:00
Dimitrios Apostolou
a0aaa4ae2e Github Actions: many minor updates
+ Add Ubuntu-20.04 Github Actions runner
+ Use as many system libraries as possible on all
  platforms except Windows
+ Checkout the git repository into a directory named "source",
  so that it's possible to checkout more repositories in the future
+ Configure with install prefix set to a temporary path,
  it will be used for uploading binary artifacts in the future
+ Configure with -pkg-config instead of -feature-pkg-config;
  this was the traditional way and it works for cmake now
+ Split long lines using double quotes instead of backslashes,
  makes the yaml file more readable and does not leak
  backslashes into the command line
+ Adjust cache to work in multiple branches, provided that the
  environment variables at the top of the file are set correctly
+ Do not let homebrew waste time cleaning up
+ Print logfiles in case of failure
+ Typos and other minor fixes.

Pick-to: 6.0
Change-Id: I1ac8afebbdbea50549a334c07b8b3117a823f0fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-22 18:48:54 +01:00
Dimitrios Apostolou
e4194b6f9e Github Actions: install old ccache version on Windows
ccache 4.0 is crashing consistently. Fix is merged upstream, but it's
not released yet:
https: //github.com/ccache/ccache/pull/736

Pick-to: 6.0
Change-Id: I27d154a1ff1ea3afe111bd8f931db58c6f518809
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-22 18:48:49 +01:00
Dimitrios Apostolou
7ff1123711 Github Actions: ccache updates
+ Specify the ccache cache directory to avoid the defaults, because
  ccache >= 4.0 puts the cache directory in system-dependent paths
+ Adjust sloppiness to increase cache hit ratio
+ print compression stats but don't err if `-x` flag is missing
  (only available only on ccache >= 4.0)
+ Print ccache config for debugging purposes
+ Enable ccache compression and limit size

Regarding the last point, ccache < v4.0 optionally compresses using the
zlib algorithm, but ccache >= v4.0 uses zstd and compression is enabled
by default.  By forcing compression to true, all platforms will need
similar size cache. We have to limit it because the default (5GB) fills
up the cache artifacts size that Github Actions offers.

Pick-to: 6.0
Change-Id: Iea72d08b223c611ee4a4443625647a1f01809b08
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-22 18:48:45 +01:00
Morten Johan Sørvig
3a1773dd76 High-DPI: Test application startup with no screens
Initialize the offscreen platform plugin with no screens,
create QGuiApplication object.

Not much of the high-dpi related Qt API can be used
in this configuration, but at least Qt should not crash
on startup.

Task-number: QTBUG-71034
Change-Id: I6620843c3bd8b692c5c2419b1ba290e16175ba5b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-01-22 14:27:27 +00:00
Andreas Buhr
df912d08c3 Update pro2cmake to require CMake 3.16
pro2cmake generated CMakeLists.txt with cmake_minimum_required(3.15.0).
But 3.16 is required now. This patch updates pro2cmake.py accordingly.

Change-Id: I8283e1c4da4d2d36e1d9127cab410c7bfc58830c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-22 15:27:22 +01:00
Alex Trotsenko
3fc6b45cbb QProcess/Win: move pipe draining into QWindowsPipeReader
... where it belongs.

To avoid the loop, introduce the drainAndStop() function, which allows
QWindowsPipeReader to flush the pipe itself. It determines the number of
bytes pending and blocks until the remainder of the process output is
received.

Note that the loop in drainOutputPipes() didn't actually have to
interleave the two pipes (because we're presuming that the operations
will finish instantly), so we don't do it now. Also, the code violated
the API contract: 'true' was returned when the 'wrong' channel received
data; this is now fixed as a side effect.

Change-Id: I38ed4861a238e39e793c3716e856e5bfdeed3d74
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-01-22 16:26:39 +02:00
Edward Welbourne
5ea701337d Mark the public suffix generator as a command-line program
It's a purely command-line program, no need for gui.
Noticed on making a first (abortive) attempt to convert to CMake.

Change-Id: I767f59587d9fe902aec46cd1742576b6bfc84274
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-22 12:16:53 +01:00
Friedemann Kleint
db942d6125 QTestlib: Speed up comparison of qsizetype
Add a qCompare() overload for qsizetype, preventing it
falling back to the slow code path pre-formatting expected/actual.
toString() should use the correct format from the already present
int-types (see macro TO_STRING_IMPL).

Complements  94aa350621.

Task-number: QTBUG-38890
Change-Id: Ieb8cea7de086141a2c80f93b4c1be01572be96df
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-22 12:11:39 +01:00
Thiago Macieira
cbdf2ba46a Update TinyCBOR
Updated to commit e6a4fa4862bcc3a6f6b07cf9d9b784d0ab6068b4.

Pick-to: 6.0
Fixes: QTBUG-89650
Task-number: QTBUG-90214
Change-Id: I6edce5101800424a8093fffd15cdf6591cbf809d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-22 03:02:39 -08:00
Alexey Edelev
e425a2a4b8 Tune compilation flags to reduce libraries size
Add '_WINDLL' definition for the MSVC compilers family.
Check the 'FEATURE_optimize_size' value before replacing compiler flags
in the qt_internal_add_optimize_full_flags function. This is required,
because Qt::Core and Qt::Gui modules lost their ability to shrink,
when selecting the appropriate build type or features.

Fixes: QTBUG-89952
Change-Id: I982c25ea84e4793b4006ead0ee516b3f3eb2a054
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-22 10:27:17 +01:00
Laszlo Agocs
df0e98d408 rhi: Pipeline cache load/save
Add QRhi APIs to retrieve and reload the contents of the "pipeline
cache".

The only API where there is a true pipeline cache is object is Vulkan
(VkPipelineCache). For OpenGL, the other backend where we support this,
it is simulated with program binaries. The Qt 5 style OpenGL program
binary disk cache continues to work like before, but one has now the
option to do things in a more modern, graphics API agnostic way, that
leads to generating a single blob instead of a large set of files in
some system location, allowing easier "pre-baking" of the cache content.

It is expected that Qt Quick exposes the two new functions in form
if QSG_RHI_ environment variables, thus allowing easy testing and
cache file generation.

As an example for the performance improvements this can give, consider
Vulkan, where we do not have any existing persistent caching mechanism
in place:

Running BenchmarkDemoQt6.exe --scene flythrough --mode demo creates 18
QRhiGraphicsPipeline objects from Qt Quick and Qt Quick 3D.

The total time spent in QRhiGraphicsPipeline::create() during application
startup for these 18 pipelines is 35-40 ms on a given Windows (NVIDIA)
system.

When exporting the pipeline cache contents to a file, and then, in a
subsequent run, reloading the cache contents, this is reduced to 5-7 ms
on the same system, meaning we get a 6-7x improvement.

The generated data is always specific to a given Qt version, RHI
backend, graphics device, and driver version. Much of the implementation
consists of adding and verifying the appropriate header to the blobs
retrieved from the driver, to allow gracefully ignoring data that was
generated with a device or driver that differs from the one used at
run time. This should provide robustness, even if the Vulkan or OpenGL
implementation is for some reason not prepared to identity and reject
incompatible cache/program blobs.

Fixes: QTBUG-90398
Change-Id: I67b197f393562434f372c7b7377f638abab85cb3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-22 10:26:03 +01:00
Joerg Bornemann
3c54b72961 Fix static top-level build
Commit d0071a4f87 broke static top-level builds:

CMake Error at .../qtbase/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake:17 (set_property):
  set_property can not be used on an ALIAS target.

Fixed by moving the un-aliasing of the target before the set_property
call.

Pick-to: 6.0
Change-Id: I96c731353798a58ff9b3a664f3614ef03c897dcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-22 09:16:10 +01:00
Timur Pocheptsov
7cf8e5ada9 QSsl: add a new private API
This is an abstraction for TLS backend and its factory, preparing to transition
to plugin-based design.

Task-number: QTBUG-65922
Change-Id: Ibe810e77fd1b715a6bea66cd3f44312b015ac274
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-01-22 09:09:46 +01:00
Samuli Piippo
946facb1ae tst_qfont: expect failure on font testcase for QEMU ARMv7
FontConfig related tests fail on ARMv7 QEMU.

Task-number: QTQAINFRA-4127
Change-Id: I3202f660d12d09a65bc50747d679921b6dfa75f8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-22 09:00:24 +02:00
Timur Pocheptsov
ee89f3a6e3 QSslSocket - introduce the API providing information about backends
This API gives the names of available backends and provides a basic
information about features/protocols supported by those backends.
Also, it has the 'loadBackend' functions which allow to select
a particular backend (which are becoming plugins).

At the moment, the implementation is still 'hardcoded', the
follow-up patch will allow to select different backends in runtime.

Task-number: QTBUG-65922
Change-Id: I05877de9c02857594e76b24d52e7578bdb01df69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-01-21 23:01:33 +01:00
Jonas Karlsson
509196b1d9 Add face support to texture file
Task-Id: QTBUG-76970
Change-Id: I3bbd43357c7fcce8949522b089a4572b948f08f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-01-21 18:33:59 +01:00
Joerg Bornemann
d95a1a8bd4 Fix separately building SQL plugins with CMake 3.16
Also move the cmake_minimum_required call to the top of the file,
because the line before already requires some policy settings, which is
what cmake_minimum_required() is establishing.

For the standard Qt build, we make sure to get appropriate policy
settings by calling qt_internal_upgrade_cmake_policies().

Pick-to: 6.0
Change-Id: If97556a9dd00646e83957959d0f9f16916625160
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-21 16:18:40 +00:00
Andy Shaw
722a7dda56 SQLite: Update to 3.34.0
[ChangeLog][QtSQL][SQLite] Updated to 3.34.0

Fixes: QTBUG-90226
Pick-to: 6.0 5.15
Change-Id: I2a489bec1fee2bdee7ea474094ca3db308699753
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-21 17:06:21 +01:00
Edward Welbourne
d5eda37baa Hold references to zone IDs alive during use
Restore holding of a getID() call's return in a QJNIObjectPrivate
eliminated in commit 78cde1bfd94521bbe4972f31a79c959d0990ea77; this
keeps the Java internal object alive for its lifetime, where it might
otherwise be garbage-collected before we're done with it.

Fixes: QTBUG-88610
Pick-to: 5.15 6.0
Change-Id: Id65b059012f7bd3377a6562c1b647feb75a13679
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-01-21 17:03:47 +01:00
Laszlo Agocs
46b892c16c tst_qvulkan: Skip assumption about supportedApiVersion
...when the platform does not support Vulkan. The version is left
at the default 0 then, so checking for >= 1.0 is wrong.

This allows the test to pass with the offscreen platform plugin.

Change-Id: I5afba8f1e703e4fa0ff41da91d18f5fabfb54868
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-21 17:00:32 +01:00
Fabian Kosmale
3861ec735e QProperty: Add private isAnyBindingEvaluating function
To optimize certain operations, it can be useful to know whether we are
currently evaluating a binding. For instance, we have properties whose
storage is only alloctaed on-demand when they are set. However, we would
also allocate them if they are used in a binding context, as we would
otherwise not properly track the dependency. Using
isAnyBindingEvaluating in the getter, we can detect this
situation, and avoid the allocation if it returns false.

This API is private for now, as it exposes some internals of the
property system and should be used with care. As it needs to access the
TLS variable, it also has a non-negligible cost.

Change-Id: I373aabee644fe7020b2ffba7d6a0ad9a1e1b4ec0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-21 17:00:29 +01:00
Ulf Hermann
150660887f tst_qsequentialanimationgroup.cpp: Avoid some memory leaks
Change-Id: Iecedb31b6993f6771b4b7a5d2708995365b8515f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-01-21 14:40:42 +01:00
Eirik Aavitsland
6797506840 Gracefully reject requests for absurd font sizes
Avoid overflows.

Fixes: QTBUG-89899
Pick-to: 6.0 5.15 5.12
Change-Id: Ic1a83c1704fe20be3d032358dc91ee8e751f2281
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-01-21 14:40:42 +01:00
Friedemann Kleint
ad84332f2b tst_socketnotifier: Fix timeout of QTcpServer::waitForNewConnection()
The timeout defaults to 0, give it 5s.

Pick-to: 6.0
Change-Id: I975810a1ecee8bb8b3a3f143f1379a9a09589a40
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
2021-01-21 08:53:35 +00:00
Craig Scott
f0ccdbb439 Only generate and add static plugin imports once per module target
Projects may call find_package(Qt6 ...) multiple times. When enabling
examples and tests, this happens a lot. For a statically built Qt,
for modules that have plugins (e.g. Gui), every time the module's
config file was loaded, it was generating and adding another copy of
the import plugin sources to the module target. These accumulated and
created many duplicates, which in turn blew out generation time and
made the build very inefficient.

This change checks whether the import plugin sources have already been
processed for the module target and ensures they are only added once.
It records its status on the target itself so that both local and
global targets are supported.

Fixes: QTBUG-90465
Change-Id: I1f45b1ee771a933ee755d44f1e983d6d9113dad0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-21 11:54:14 +11:00
Tor Arne Vestbø
af0fa5cffe macOS: Only check SDK major version for compatibility
The macOS SDKs now follow the same major/minor version scheme as iOS,
where the major version is bumped for each OS release.

Pick-to: 6.0 5.15
Change-Id: I021421a9c58bb1ae64bc0c63b4215f14e4ada358
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-01-20 19:11:05 +01:00
Christian Ehrlicher
b002c21087 QPushButton: fix drawing pushbutton with a menu
Drawing a QPushButton with a menu results in a clipped label text and a
wrong aligned decoration and menu button.
The position of the menu button was calculated wrong (spacing has to be
subtracted since the start position is the right side). Also the text
label alignment was done before it was adjusted for the menu button
which results in an unaligned (in constrast to a pushbutton without a
menu) label and decoration.

Fixes: QTBUG-89619
Change-Id: I872d39ff2d8eb685fe6843e38c7f727868e1ee9a
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Funning <huangyub@uniontech.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-01-20 17:28:10 +01:00
Richard Moe Gustavsen
427e639275 iOS: ensure we close the edit menu when the user taps outside the input area
iOS used to close the edit menu automatically when
the user tapped on the screen (even for menus shown
explicitly using the UIMenuController API). Apperently
this has now changed (probably as a part of
[UIMenuController setMenuVisible:] being deprecated in
iOS 13). So we now need to hide it explicitly.

Because of this, we no longer close the edit menu if
the user taps outside the input area. This patch will
fix this by updating the logic in QIOSTapRecognizer to
close the menu explicitly.

There are some more details around when to show or hide
the menu, which is commented on at the relevant places
directly in the patch.

Pick-to: 6.0 5.15
Fixes: QTBUG-90332
Change-Id: I336e3f4003817b39c7abf63f963fde1f3ef87c20
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-01-20 16:52:21 +01:00
Richard Moe Gustavsen
2e35a03cd6 iOS: ensure we hide the edit menu while dragging on the selection handles
iOS used to close the edit menu automatically when
the user tapped on the screen (even for menus shown
explicitly using the UIMenuController API). Apperently
this has now changed (probably as a part of
[UIMenuController setMenuVisible:] being deprecated in
iOS 13). So we now need to hide it explicitly instead.

Because of this, the edit menu would be showing together
with the magnifier class while the user was dragging on
any of the handles. This patch will fix this, so that we
close the edit menu explicitly whenever the user starts
dragging on a handle.

Pick-to: 6.0 5.15
Fixes: QTBUG-80298
Change-Id: Iff2032d64db1b582fa7f048c6a1f37ec8a1528af
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-01-20 16:52:17 +01:00
Sergio Martins
61c3f3539c Make QStyle::proxy() always return the leaf proxy
For example:

  fusion -> proxy1 -> proxy2

Now returns proxy2.

Fixes: QTBUG-85556
Pick-to: 6.0 5.15
Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-20 15:35:46 +00:00
Ivan Solovev
fb51b4732c Add simple benchmark for QRegularExpression
The benchmark simply calls QRegularExpression's public API methods, so
that we can assess how changes to the implication impact performance.
(Its addition is prompted by evaluation of whether adding a move
constructor saves more or less than the resulting need for
d-pointer null-checks costs.)

Task-number: QTBUG-86634
Change-Id: Idef775ef6cf9f9ded3ce7ba5b85e460571d12756
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-20 16:31:07 +01:00
Mårten Nordheim
0875626e22 Long live QNetworkInformation
The plugins are meant to indicate what they do support, meaning users of
QNetworkInformation can choose to not care about which plugin is used
and rather just request what they want.

Task-number: QTBUG-86966
Change-Id: Ie130e1791250ec2a4470e3ba7081d982654af06c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-20 16:21:28 +01:00
Joerg Bornemann
7e7dacc109 Do not export the QT_PLUGINS target property of Qt modules
This property is dynamically determined and set in the
Qt6${module-name}PluginsConfig.cmake files now.

There is no need anymore to export this property.

Change-Id: I2d164864c4099034b88f9ad852eae8b9f9e55f8b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-20 15:25:08 +01:00
Joerg Bornemann
d0071a4f87 Fix loading of Qt6*Plugin.cmake files of per-repo builds
When doing a per-repository build of Qt, as it is done for the installer
packages, the build of qtbase has no knowledge of plugins that might be
built and installed from other repositories. That means we must not
write a fixed list of known plugins when exporting Qt modules of qtbase.

In particular, qtsvg adds imageformat plugins that are supposed to be
picked up by qtbase's QtGui module when linking a project against a
statically linked Qt.
${install-prefix}/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake missed the
include statements for qtsvg's plugin config files and operated on a
fixed list of plugins, all from qtbase.

Apart from that, the Qt6::Gui target's property QT_PLUGINS did only
contain the qtbase plugins.

This patch fixes the situation in the following way:

1. All Qt6*PluginConfig.cmake files in
${install-prefix}/lib/cmake/Qt6Gui are detected and included.

2. From those file names, the target names of the plugins are
deduced. This is safe as the file name of those generated files is a
direct result of the plugin's target name.

3. The QT_PLUGINS property of the module is updated with the detected
plugin target names.

Fixes: QTBUG-89643
Change-Id: Ifc3c39aa9948277ead5ebb209ec5eff64746308b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-20 15:24:47 +01:00
Joerg Bornemann
f379938443 pro2cmake: Raise QT_REPO_MODULE_VERSION to 6.1.0
Modules that are ported for dev should get this version now.

Change-Id: I11d47504f163798d53c51e56ef978edaa711d93a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-20 15:24:29 +01:00
Eirik Aavitsland
e1ed570f9d Rasterizer: compute intersection factors only when needed
Fixes oss-fuzz issue 29285

Pick-to: 6.0
Change-Id: I8f7e0bc898b119d153a36cef5a74371249ed7686
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2021-01-20 15:19:37 +01:00
Edward Welbourne
f9fff26b2d Fix QTzTimeZonePrivate::displayName()'s fallback
It previously fell back on abbreviation, a very poor choice.
The base class does better than that, so use its implementation instead.

Pick-to: 6.0
Change-Id: I47cbfce815cd8b2b533d9c6aeebcf398e5852d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-20 14:18:46 +00:00
Alexey Edelev
df788cca8b Generate Qt6EntryPointAdditionalTargetInfo independent of platform
Move AdditionalTargetInfo generation for EntryPoint target out of
WIN32 specific block

Fixes: QTBUG-90414
Change-Id: I8dc34c939f12ef2073de630d4440a0892d8be909
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 32734f351b076b8774c490c27ef18ddd2243dcaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 14:03:45 +00:00
Andy Shaw
15576c9610 iOS: Handle keyboard events when using an external keyboard
This enables the two possible approaches for handling external keyboard
events. While support still exists for before 13.4 then both approaches
are needed. This ensures that all external keyboard events are handled
as key events and passed on accordingly. Additionally, this accounts
for possible shortcuts too, therefore a new function is added to
QShortcutMap to aid that.

As a result, code has now moved from QCocoaKeyMapper to be part of the
gui/platforms/darwin part to make it easier to reuse this code
elsewhere.

Fixes: QTBUG-85727
Change-Id: I349af43468b03fd8dcb16adba02669974affe154
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-20 12:29:38 +01:00
Pekka Gehör
a5bb7b3ca5 [Android] Fix Text select handle misplaced on fields inside QDialog issues
Get cursorPoint from a mapToGlobal with a cursorRectangle of the selected inputMethod

Fixes: QTBUG-65229
Fixes: QTBUG-58503
Pick-to: 6.0 5.15
Change-Id: I89b056fa91c59d260f02164c9bd6672b5ada64d6
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-01-20 08:23:26 +00:00
Alexey Edelev
e5a8623032 Add arguments to 'qt_manual_moc' to resolve 'moc' includes
'qt_manual_moc' doesn't provide include paths for 'moc' command to
substitute required macros. This change adds the
'INCLUDE_DIRECTORIES' and 'INCLUDE_DIRECTORY_TARGETS' arguments to
the 'qt_manual_moc' function.
If 'INCLUDE_DIRECTORY_TARGETS' is specified, 'qt_manual_moc'
collects 'INTERFACE_INCLUDE_DIRECTORIES' of provided targets and
uses them as the 'moc' include directories.

Change-Id: I58c8887dae3ca2484574c5e12e2cbd47f5bd3648
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-20 08:55:48 +01:00
Giuseppe D'Angelo
ca211da2fa QLocale: add a Q_CHECK_PTR
Avoid complaints from static analyzers that the pointer returned
by malloc might be null.

Change-Id: I3ec3ba03d0b5283dd569200a3040a5fe5990f763
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-20 08:36:00 +01:00