Commit Graph

45819 Commits

Author SHA1 Message Date
Tor Arne Vestbø
f76161d61f Move QRasterBackingStore to QtGui
Task-number: QTBUG-83255
Change-Id: I339173de6e109c5a9b9572972ba894c15053c034
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-21 20:28:37 +02:00
Lars Knoll
2f05aa82e7 Adjust resize() behavior of QString and QByteArray to match Qt 5
resize() to a smaller size does not reallocate in Qt 5 if the container
is not shared. Match this here.

As a drive-by also fix resize calls on raw data strings to ensure
they are null terminated after the resize.

Change-Id: Ic4d8830e86ed3f247020d7ece3217cebd344ae96
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-21 17:59:31 +02:00
Tor Arne Vestbø
42024666a3 Move QMacInternalPasteboardMime to QtGui
Task-number: QTBUG-83255
Change-Id: I00fda24479ad2c04781c5fefaa15fac1118033a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-21 13:21:53 +02:00
Alexander Volkov
9bad3508fc Add missing override
Change-Id: I88000e82ecbdc55e621dc8e22aff5e8f55cf9d0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-21 11:34:12 +03:00
Timur Pocheptsov
e7ca98f40f QSslSocket::addCaCertificates - do not duplicate certs
If we already know the certificate, there is no need in adding it again.
This function is deprecated, but will stay forever in 5.15.

Pick-to: 5.15
Change-Id: I760f5bcffea78ac02c5643ee1112725edd32f15a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-05-20 19:46:16 +02:00
Timur Pocheptsov
c86e54fb17 Make OpenSSL back-end work with 3.0 alpha
DSA/DH/etc _bits functions were first deprecated, then un-deprecated,
so we don't worry about them for now. SSL_CTX_load_verify_location was deprecated
and two new functions were introduced instead (one using file, the second
- path). It's unfortunately 3.0 only, so we have to check OpenSSL version.
DH_check is deprecated and we have to use EVP_PKEY_param_check with
tons of a boilerplate code around.

Fixes: QTBUG-83733
Pick-to: 5.15
Change-Id: Icd401ab6aad30c23c37443c7bc82c702fb843640
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-05-20 19:45:53 +02:00
Joerg Bornemann
32cb48e26c Revert "CMake: Don't create *Depends header for header-only modules"
This reverts commit e875f45805.

Reason for revert: syncqt creates a master header that includes
the *Depends header. Therefore we must always create the *Depends
header. Ignore for now that *Depends headers are empty and pointless
for module headers.

Change-Id: I1dcc836788b3d46c4f1b504d2d64e9eb67b66206
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-20 17:27:30 +02:00
Joerg Bornemann
aa097aa028 CMake: Hot fix for Ninja Multi-Config with MSVC and OpenSSL
For now, we have to turn off the 3rdparty lib generation code for
qt_lib_XXX.pri files, because it's broken for NMC if the 3rdparty
libraries have different binaries per config.
The actual fix is more involved.

Task-number: QTBUG-84348
Change-Id: I863e69085b68c0dbbb3f6c415111bc255799e155
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-20 17:27:28 +02:00
Joerg Bornemann
0b01e62ff4 CMake: Move qt_lib_XXX.pri generation to module finalizer
Introduce a qt_finalize_module function that is called as a
CMakeLists.txt finalizer and call qt_generate_module_pri from there.

This is done in preparation for writing the QT.XXX.depends entries to
the module pri files, because we must do this after all dependencies
have been added.

Change-Id: Ia61db73383541651389fd647523ef535792874d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-20 08:24:31 +02:00
Marc Mutz
e1cab870cb Extend QTypeInfoMerger to more than four arguments
Use template argument pack and C++17 fold expressions.

Because MSVC doesn't grok fold expressions in
enumerator-definition contexts, use static constexpr bool
variables.

Change-Id: I13a676d9be687679ef41f7b003e50116c4cd533c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-19 21:45:57 +00:00
Marc Mutz
7c070ac959 Sweep Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6 -> Q_DECLARE_SHARED
This is Qt 6, so Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6 is the same as
Q_DECLARE_SHARED.

Let's hope we'll collectively get better at detecting missing
Q_DECLARE_SHARED so we won't need a
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT7 in the future.

Change-Id: I3da9faff4c66b64a3b257309012a2a10a6c6d027
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-19 23:45:54 +02:00
Andy Shaw
857722ed8f Android: Only have one valid QMimeData object kept around
Once the clipboard data is queried then we can clean up the previous
QMimeData object created. So rather than keeping on to it and cleaning
up when the clipboard is created we can delete it at that point. This
means it is not necessary to make it a QObject subclass, so we can save
in that respect too.

Pick-to: 5.15
Change-Id: I152ca6ea5c713abe25f75ca2016759c0e3152bfb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-19 21:40:35 +00:00
Andy Shaw
77e978001b Android: Clear the m_selectedFile variable when showing again
Since the helper is being reused then the m_selectedFile variable should
be cleared, otherwise it ends up appending the new result to the old
one.

Change-Id: I72c24409dc91f91bad55a7da2772605f03fb4623
Pick-to: 5.15
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-19 23:40:24 +02:00
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