Commit Graph

45956 Commits

Author SHA1 Message Date
Robert Loehning
4c9acd103b Fuzzing: Add fuzz target for QImage::loadFromData
Pick-to: 5.15
Change-Id: Ie67eb9be80fe42d463c566c728c73c9c92c2081b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2020-05-19 23:18:16 +02:00
Alexandru Croitor
9da90fab67 CMake: Use provided OUTPUT_DIRECTORY for manual tests and benchmarks
If an OUTPUT_DIRECTORY option is provided, it should be used instead
of discarding it.

Change-Id: Ie53b56616f16589f7c05ff9378d7ba2e2ba34726
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-19 19:09:00 +02:00
Jan Arve Sæther
5b3a86a87b a11y: Fix bug in the accessibility cache
We could sometimes cache a partially constructed object if the accessibility
interface for that was created during construction time of the object. This
usually ended up in that the interface for e.g. QMenuBar was stored in the
cache as a QAccessibleWidget, regardless of if the a11y factory supported it.
Since it was already in the cache, it remained the same for the entire lifetime of the
application, causing e.g. QMenuBar not have the correct accessibility behavior.

Task-number: QTBUG-83993
Change-Id: I72b2d5a93f6b397fd3666d45951109e3e5aff754
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2020-05-19 13:33:02 +02:00
Joerg Bornemann
3dc3c0e2b6 CMake: Append to QT_CONFIG in the qt_lib_XXX.pri files
The module pri files are supposed to add their public features to the
global QT_CONFIG variable.

Change-Id: I9a1719f897747a1d89011b1f1231c05a23539def
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:29:57 +02:00
Joerg Bornemann
a12d28f467 CMake: Fix reading of INTERFACE_* properties in pri file generation
Change-Id: I3d1b1910239ada44d393f8c2c8803f33f7b64189
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:27:21 +02:00
Joerg Bornemann
3434e15ebd CMake: Fix calling finalizers with empty arguments
Change-Id: I7a826a4cd5e38882932476ef31cdb949cc1949c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:27:15 +02:00
Joerg Bornemann
422649a59f CMake: Fix empty plugin_types value in module pri files
Avoid writing module_plugin_types-NOTFOUND into the module .pri files.

Change-Id: I2fed7b0d1c21e2233eebcaca419f522a07d22af4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:27:07 +02:00
Joerg Bornemann
c975c35eae CMake: Generate qt_plugin_XXX.pri files
Task-number: QTBUG-75666
Change-Id: I4ea0679fa0c62a486d03568525ad60697709fe68
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:27:02 +02:00
Joerg Bornemann
759da6742a CMake: Generate information about 3rdparty libs in module .pri files
For modules that are not yet ported to CMake and that use
   QMAKE_USE += libfoo
we need to provide the information about libfoo in the qt_lib_XXX.pri
files.

Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs.

Task-number: QTBUG-75666
Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:26:53 +02:00
Mårten Nordheim
aed7a65b8b QAuthenticator: Reprioritize authentication methods
The addition of Negotiate to QAuthenticator caused a soft sort of
regression in environments where there is key distribution center
set up. This was due to how QAuthenticator works in that it will
simply prefer the latest entry in the enum, which now was Negotiate,
which sadly wasn't really a valid option in that situation. And it is
not smart enough to fall back and try another method.

To work around this issue we re-order the enum to prioritize
authentication methods to restore previous behavior.
Note that Negotiate is still preferred over Basic and None because
they're not likely to appear together.

Pick-to: 5.15
Task-number: QTBUG-83905
Change-Id: Ic528318b6b711aa04d42a86c684452bb6ebde112
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-05-19 09:18:40 +00:00
Alexandru Croitor
19b6ae6637 Fix relocated Qt to be found when its path has non-ASCII characters
The path returned by dladdr seems to be encoded with the current
locale encoding which means that if it contains unicode characters, the
fromLatin1() call mangles the path, and QFile::exists reports that
the path does not exist.

To preserve non-ASCII characters use fromLocal8Bit() instead.

This should fix the runtime issue of finding the Qt prefix when the
Qt library path has non-ASCII characters.

Amends 2f52afda8e.
Amends 4ac872639e.

Fixes: QTBUG-84272
Task-number: QTBUG-15234
Pick-to: 5.14 5.15
Change-Id: I37019ed219cf2cf7d9663cb1e16acdb97b3bdf09
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-19 10:16:23 +02:00
Alexandru Croitor
941039356d CMake: Use the same generator when building other repositories
If we configure qtbase with Ninja Multi-Config, we should use the same
generator when building other repositories as well, to ensure that
all repositories have the same set of configurations (debug and
release). To do that, the Coin instructions will call the
qt-cmake-private wrapper which records the generator used.

For standalone tests continue to use qt-cmake, so that only a single
configuration is built (no need to build tests in both debug and
release mode). The configuration built will be the first one from
the initial list with which qtbase was configured (usually
RelWithDebiInfo). This is ensured by the
QtBuildInternalsExtraConfig.cmake file.

Task-number: QTBUG-80900
Change-Id: I701b2f652a22d51e640a6fdf19c3b2d2dfb34d5c
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-19 10:16:16 +02:00
Alexandru Croitor
b3e01d608e CMake: Use custom install script to support Ninja Multi-Config builds
Calling cmake --install . only installs a single configuration.

To install both debug and release artifacts, the install
invocation needs to be done for each configuration.

To keep the Coin instruction code simpler, delegate the looping
over configurations to a custom CMake script, and use it in the
Coin instructions.

Replace all cmake --install calls in the instructions with calls
to either call_host_install.yaml or call_target_install.yaml.

The path to the script depends on whether we are building
qtbase or another module. In the former case the script should
be called from the build dir, otherwise from the install dir.

The other distinction is whether the host or target env prefix
needs to be added.

Task-number: QTBUG-80900
Change-Id: Ied4bf739e2b1a2307f22fc79c1cfad746c8cbc44
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-19 10:16:11 +02:00
Alexandru Croitor
f240d94f14 CMake: Install non-main-config tools and executables to a subdir
When using Ninja Multi-Config, we don't want to install a "Release"
moc.exe, and then override it with a "Debug" moc.exe.

Because it doesn't seem possible to exclude installation of targets
per configuration, put the non-main configuration tools into
configuration specific subfolders like "bin/Debug", so no overriding
happens upon installation.

Introduce a new function qt_get_install_target_default_args() which
returns install destination arguments for consumption in qt_install()
calls. The function adds the config-specific suffix to the destination
for the appropriate configs.

Each call to qt_install *adds* new rules for installation,
which means that export registration needs to happen only on the first
call.

Make sure qt_add_tool doesn't ask qt_add_executable to install
yet again, to create duplicate rules.

Apply the same install arguments logic to qt_add_executable calls.

Task-number: QTBUG-80900
Task-number: QTBUG-80901
Change-Id: I3e732d27dba5bf5f8059d2878ef1e425237d383a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-19 10:16:08 +02:00
Alexandru Croitor
fae09465c7 CMake: Default to building all configurations with Ninja Multi-Config
Thus we will build both Release and Debug configurations in Coin
when cmake --build . is executed, mimicking qmake's make which
builds both configurations in debug_and_release.

Task-number: QTBUG-80900
Change-Id: If48aca249eb84e690d3f9d51a733b3a25df1f7ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-19 10:16:05 +02:00
Alexandru Croitor
06b148074a CMake: Allow using single config generators after building with NMC
Where NMC is the CMake Ninja Multi-Config generator.

The first use case is to allow building standalone tests with one
configuration even if Qt was build with multiple configurations.

Another use case is for regular Qt consumers that might use the
generated qt-cmake shell script which does not have the generator
specified (as opposed to qt-cmake-private).

Another detail is to use the first configuration from the initial
Qt configurations list (CMAKE_CONFIGURATION_TYPES) when building
standalone tests with a single config generator, so that it doesn't
default to Debug, but rather to the provided first configuration.

This matches qmake behavior, where on Windows with a
debug_and_release configuration, tests are still built against
release.

Task-number: QTBUG-80900
Change-Id: I0da91c1f91095332cfe9e38d17f440aad6a09d15
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-19 10:16:01 +02:00
Marc Mutz
2259a433ca QString: throughly port internals to char16_t
This includes allocating QString data as char16_t instead of ushort.

This isn't the end of the port, but an important milestone: the
traditional foldChar() functions are now all unused.

Change-Id: I766bebc2d70b6972e2045d3474c7f5770f4676d9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-19 10:15:38 +02:00
Andy Shaw
60ec350bc7 Windows: Update the hasFrame setting when changing window flags
Since changing the window flags can make it frameless or have a frame
then it should ensure that the hasFrame setting is updated accordingly
when the window flags do.

Change-Id: I7bf4995d7967623b117426d8750e63fa97967e2c
Pick-to: 5.15
Pick-to: 5.12
Fixes: QTBUG-84029
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-05-19 10:15:30 +02:00
Allan Sandfeld Jensen
63a88d0d26 Allow multithreaded opengl to be disabled
Pick-to: 5.15
Change-Id: I5bffb6d6844c19adc575d86d5f9846af344a8679
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-19 10:15:18 +02:00
Allan Sandfeld Jensen
dddd0c3ad8 Add error message on unaligned profile inputs
Pick-to: 5.15
Task-number: QTBUG-84267
Change-Id: I7ec2100455bd0178cdff0de2d24abbe6c19f812f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-19 09:31:35 +02:00
Kai Uwe Broulik
cdfafec01b QTreeView: Use devicePixelRatioF for cached animation pixmap
Ensures it stays crisp also when using fractional scaling.

Change-Id: I4a319929bca0e2dc4810c2c07d06f98b7f4e10b4
Pick-to: 5.15
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-05-19 09:27:36 +02:00
Kai Koehne
b19ccc3af4 Remove -qt-xcb, -system-xcb from README and comments
The options got removed in commit 60588e1a5d

Pick-to: 5.15
Change-Id: Ic94f58885dab6de3c563b3dab70385570864b47d
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2020-05-19 06:42:35 +00:00
Kai Koehne
9981744684 Configure: Do not automatically enable compilation of examples for tests
If user's specified to build without examples we shouldn't silently
overwrite this. This might mean that some tests will fail to run then,
though.

Fixes: QTBUG-84087
Pick-to: 5.15
Change-Id: I53748fc03354ffdf015f85c93efc6e86c446adb8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-19 08:42:19 +02:00
Liang Qi
b2c991bfea Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-05-19 08:21:02 +02:00
Samuli Piippo
8718b0d070 cmake: add config module name for devicediscovery
Add special case for using correct module name.

Change-Id: Icfd88eccfa8adf55a69091d86a01bd1658fe2b54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 08:51:44 +03:00
Friedemann Kleint
26100ccb83 Direct Write Font Engine: Fix leaking IDWriteFontFace instances
Patch as contributed on bug report.

Pick-to: 5.15
Pick-to: 5.12
Fixes: QTBUG-84265
Change-Id: I73d73cf7d1b46944767750bf0f0c727c7b00b1d7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-05-19 07:44:34 +02:00
Lars Schmertmann
1b7589a25c Enable Universal Links on iOS
Pick-to: 5.15
Change-Id: I05b5bede49f619576dd9ab37444f7cb5fe0f15f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-19 06:37:03 +02:00
Jani Hautakangas
4683b0b57f webOS: Fix allocateTimerId
Change-Id: I8b3777f4035401763d86b0245de43b63573b9ea6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-18 17:20:15 +09:00
Jarek Kobus
8a11641bb9 Enable setting custom QThreadPool for QtConcurrent methods
Task-number: QTBUG-53465
Change-Id: Icff05d5f65dce453ff702502b85c35e20fca86a9
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-05-18 10:03:29 +02:00
Liang Qi
2cd6d76d68 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/text/qbytearray.cpp

Change-Id: I63706409464d31391012bacdadfd1f6300509787
2020-05-18 08:52:33 +02:00
Friedemann Kleint
4857fee0fc Windows QPA: Fix window class name clash when mixing Qt libraries
Fix the check of the return value of GetClassInfo() to detect
a clash when mixing libraries with identical Qt namespaces.

Pick-to: 5.15
Fixes: QTBUG-84005
Change-Id: I2d13b909a85dae947c65551b7e390334c83d2e2a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-05-18 08:10:29 +02:00
Lars Knoll
b800f3039a Cleanup qUncompress
Cleanup the code in qUncompress and make use of QArrayDataPointer
to keep track of memory.

Change-Id: I2c11f0468813698d2b7c25acd0f8786a289739a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-17 20:37:48 +02:00
Lars Knoll
88c72d972a Don't access QArrayData::sharedNull() from QByteArray anymore
Change-Id: I1292f8d2d62fa96ae4c6aa91c7c95c1f3a18570f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-17 20:37:42 +02:00
Marc Mutz
fae7a47bb3 QChar: make fullConvertCase()'s result type more usable
Move it into the function, give it an explicit size and make it
iterable and indicate to QStringView that it's a compatible container.

Change-Id: I483d9225ac73ad93f2037489f2d32473c377e8b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-17 18:06:17 +02:00
Joerg Bornemann
e875f45805 CMake: Don't create *Depends header for header-only modules
Set the target property INTERFACE_MODULE_IS_HEADER_ONLY for
header-only modules, and only create *Depends header files if this
property is falsy.

Change-Id: Ic6b100787d18b3ff1f7b9d0f2b5c744018b1f295
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-16 22:02:10 +02:00
Marc Mutz
395fa85403 Add central macro to disable float comparison warnings
QParsedNumber will need it, as do some others, like QAngle.

Change-Id: Iee09f498d2cdbb28d43b94301328ec7858661ad2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-16 20:24:32 +02:00
Marc Mutz
3df3bdcdb3 QTaggedPointer: verify constexpr'ness of some ctors
Change-Id: I44196ba3a823ce04b7c82aacfb9da301cc0f1886
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-16 08:55:28 +02:00
Sona Kurazyan
1a5cc8d13d Add support of cancellation handler callbacks to QFuture
Added QFuture::onCanceled() method, for attaching handlers to be called
when the QFuture gets canceled.

Change-Id: I1f01647d6173ba0c1db6641e14140108b33ac7c4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-15 22:35:30 +02:00
Sona Kurazyan
612f6999c8 Add support of connecting signals to QFuture
Introduced QtFuture::connect(sender, signal) function returning a
QFuture object, which is resolved when the signal is emitted.

Task-number: QTBUG-81589
Change-Id: Idbe301eb247b468b9b34f3470c3359d6a7af2f3a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-15 22:35:06 +02:00
Takao Fujiwara
54aa63be9b IBus: Use WAYLAND_DISPLAY on Wayland sessions to make up socket names
A recent change in IBus made it prefer the WAYLAND_DISPLAY envvar in
order to compose its socket path for Wayland sessions. This is because
DISPLAY is unreliable in those environment: It might not be there, there
might be several displays pointing to the same Xwayland server (as it's
the case in GNOME 3.36), or there might even be multiple Xwayland servers
(eg. to enforce inter-app isolation with X11 apps).

Fixes: QTBUG-82910
Pick-To: 5.15
Change-Id: I4883b5d06863ba284883dd95281bed2ce7203e29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-15 20:11:11 +00:00
Marc Mutz
5ffa5808f8 QTaggedPointer: some API cleanups
- don't refer to the class with template arguments in the body of the class
  (incl. one where we got the template args wrong)
- make namespace-level swap a non-member friend
- make default ctor constexpr and non-explicit
  (default ctors should never be explicit)
- make ctor from std::nullptr_t constexpr
- remove op= from std::nullptr (will be handled by op=(T*) anyway)
- pass QTaggedPointer by value (it's a Trivial Type, so can be passed in registers)
- fix missing QTypeInfo for non-default Tag types
- remove unused include limits.h
- make qHash-able (why is the tag ignored?)

Change-Id: Idee1d685ac365c988698a8637fd5df3accfc1396
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-15 20:00:24 +02:00
Joerg Bornemann
e5683c5e5f CMake: Add MODULE_INCLUDE_NAME one-value-keyword to qt_add_module
This value is the equivalent of qt_module.prf's MODULE_INCNAME and can
be used to specify a name for the module's include subdirectory. The
default is Qt<ModuleName>.

The include name is stored in the module's target property
MODULE_INCLUDE_NAME.

Change-Id: Ie6c8f6882ee2c3db78884ae5781593c803be3c05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-15 18:56:27 +02:00
Volker Hilsheimer
2b10a192a1 Remove deprecated method from QFont, QFontMetrics, and QFontInfo
Change-Id: Ifc8fb5c5d53359b33b8abab3bbee3de61bfef539
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-05-15 18:56:20 +02:00
Fabian Kosmale
794150e5bd QMetaType: Support char16_t and char32_t
Change-Id: Ieec6d4bc64967d875ea12b31638aab05bc682ea3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-15 18:46:39 +02:00
Volker Hilsheimer
45cf8da63c Reduce QDesktopWidget API to bare minimum
The class is documented as obsolete, and the majority of APIs is marked
as deprecated. In this first phase, remove all explicitly deprecated
APIs and trivial implementations.

The test case is complete removed; what's left when code that uses any
of those deprecated methods is removed is not testing anything
meaningful.

For some methods, there is no practical replacement using QScreen yet,
and QDesktopWidget is still used in QWidget internals. Those require
refactoring to only use QScreen before the rest can be removed.

Change-Id: I8f7c968ec566820077221d37b817843758d51d49
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-15 18:46:39 +02:00
Andy Shaw
9803ba9b6f Deprecate QGuiApplication::paletteChanged() signal
Rather than have a paletteChanged() signal which can be connected to for
tracking when the application palette has changed, then it is better to
use the event that is sent to all windows and the application itself.
That way it is easy for a window/widget or item that cares about the
change to the application font to catch it in the event() function.

[ChangeLog][QtGui][QGuiApplication] Deprecated paletteChanged() signal
in favor of QEvent::ApplicationPaletteChanged.

Change-Id: I95da211e30590e357007cc14d8ee266baceba7b3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-15 18:46:39 +02:00
Mårten Nordheim
bd3b978701 QNetworkReply: Remove some bearer management leftovers
migrating backend was done if the QNetworkSession changed. With
QNetworkSession gone this was no longer called from anywhere.

Change-Id: I8c995001f9d4c7ae83446b4d29fa62c954c79889
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-05-15 15:44:22 +02:00
Andy Shaw
035c16e9ff Use correct order of arguments when calling QCalendar::daysInMonth()
Change-Id: Ic4e30d8ffea80c1dc1dc8da1f97f4bb0d21b63e3
Pick-to: 5.15
Fixes: QTBUG-83870
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-15 15:44:22 +02:00
Fabian Kosmale
40c6fe88a4 cmake: QTestCase: enable threading support
Change-Id: I55a9b57172659ae420890556e55810bf7f4a725c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-15 11:47:11 +02:00
Alexandru Croitor
0cdcbb40a1 CMake: Enable default usage of utf8 sources for Qt consumers
And enable the same default when building Qt itself (it's implicit).

Allow opting out on a target-by-target basis, by using the public
qt_disable_utf8_sources() API call.

Change-Id: Ifc19a744d57b96b1c74a6926a0c6628c2a820464
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-15 11:47:09 +02:00