Commit Graph

45734 Commits

Author SHA1 Message Date
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
Joerg Bornemann
d5cb44cd3a pro2cmake: Fix Scope.get_string for list values
QMake variables are always string lists, but some variables are used to
represent single string values. People tend to fill those variables with
multiple values and expect them to be joined by spaces.

Exhibit A: qtdeclarative/tools/qml/qml.pro
    QMAKE_TARGET_DESCRIPTION = QML Runtime

QMake supports this for many values. Do the same for Scope.get_string().

Change-Id: I6af22bc1bfed07a4d8eac94d7315051a5bcb7a4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-15 08:54:21 +02:00
Marc Mutz
c5f7cb7e14 QString: remove more functions overloaded on char
These functions mess in bad ways with the overload set (they, fatally,
attract char16_t, e.g.).

The no-ascii warning now comes from the QChar(char) constructor, so
it's not lost.

[ChangeLog][QtCore][QString] Also removed op=(char), op+(char,
QString), op+(QString, char).

Change-Id: I1471c9ddb4c6869aff6e527516e2c78b80b7d7d3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-15 05:01:00 +02:00
Marc Mutz
b655734965 QString: fix an aliasing issue in remove(QString)
Even in Qt 5, remove() can be passed an alias to *this. In Qt 6, with
the advent of substring sharing, this will become even more
pronounced. Use the same fix as was already used in QString::insert().

Pick-to: 5.15
Change-Id: I1a0d3d99fd7dff6e727661646d2cbfdc94df2682
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-15 03:00:45 +00:00
Andy Shaw
f468f76455 Add an option to set the alignment of the text in QComboBox
Change-Id: Ic9dca8864643302b2b3ff7dbd86260efdb0ab1d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-05-15 05:00:10 +02:00
Volker Hilsheimer
6028e16b86 Remove deprecated QAccessible::updateAccessibility overload
Change-Id: Ib953e584685804b0f34ec6b305e2a9a6b8062c07
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-05-15 04:59:30 +02:00
Volker Hilsheimer
6f34c0c650 Initialize TextureOp and BufferOp structs
Fixes Coverity warnings, and avoids hard-to-debug errors, at minimal
overhead.

Change-Id: I3ff530a9263693d1123932458b3e186e79a14b7e
Coverity-Id: 263692
Coverity-Id: 263693
Coverity-Id: 263699
Coverity-Id: 263700
Coverity-Id: 263702
Coverity-Id: 263705
Pick-to: 5.15
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-15 04:59:20 +02:00
Volker Hilsheimer
7bee4e9cb3 QLabel: lay out text using a text control when label can get focus
QLabel ensures a text control in its focusInEvent, and from that point
on lays the text out using the control. A label with text control will
place the text so that there is space for a cursor and text selection,
resulting in text shifting when a label receives focus without having
had a text control before.

Instead of creating the control only on focusIn, ensure that it's
created for any QLabel that can receive focus.

Change-Id: I26c9df3affa08f2360ad4b94de43bd85e2e2e164
Fixes: QTBUG-84080
Pick-to: 5.15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-05-15 04:59:07 +02:00
Dmitry Kazakov
d26ee69140 Fix artifacts when rendering multisubpath dashed QPainterPath with openGL
It might happen that the resulting subpath generated by the QDashStroker
will have no lines at all. It happens when further LineToElement items
compare as equal to the starting MoveToElement when compared in 'float'
space. In such case QTriangulatingStroker::process() skips LineTo elements
and the vertexBuffer ends up with unconnected vertices, which generate
unwanted triangles.

See related bugs:
https://bugs.kde.org/show_bug.cgi?id=419240
https://bugs.kde.org/show_bug.cgi?id=413220

Change-Id: Ie70955287da47e9f7aa9cdeaea506e1c817b2317
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-15 02:06:25 +03:00
Marc Mutz
3b7f278d38 tst_qstringref: remove some wtf?
As best as I can guess, this used the QString::operator=(char), which
I locally removed. Before that lands in Qt, remove this ... wtf?

Pick-to: 5.15
Change-Id: Ie083fe69500d6b5b633416f89f5dd1d7068c20b2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-14 20:30:35 +00:00
Marc Mutz
49e69827d2 QString: fix quadratic behavior in QString::remove(QString)
Calling linear-complexity remove(int, int) in a loop is O(N²).

Fix by implementing a remove_if()-like algorithm which ensures each
character is written at most once, which is linear.

[ChangeLog][QtCore][QString] Fixed quadratic worst-case complexity of
remove(QString). The function now has linear complexity in all cases.

Pick-to: 5.15
Change-Id: I12f70fbc83fb5da4a9aae4bd02f525d7657cc940
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-14 20:30:22 +00:00
Joerg Bornemann
786ae0141a CMake: Don't hard-code the sysroot in Qt5XXXConfigExtras.cmake
Instead of writing the hard-coded sysroot into the .cmake file, write
the variable ${CMAKE_SYSROOT}. This makes it possible to relocate the
build to a machine where the sysroot is different from the build
machine.

Fixes: QTBUG-83335
Change-Id: Iaa69feb9a140b050f6b5547929cc940ee0f039ce
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-14 21:36:59 +02:00
Lars Knoll
7ea6cee525 Don't enable -headerclean by default even for developer builds
The CI system can test this, but there's little reason to blow
up every developers compile time by 30%.

Change-Id: I7677b0411103fb1301ad087c884cc9bd22a5aee2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-14 19:16:33 +02:00
Lars Knoll
b4fd377aa9 Make utf8_source the default for qmake builds
We now assume that source code is encoded in UTF-8 by default on
all platforms (and verify this with an auto test). Provide
a CONFIG+=no_utf8_source option for backwards compatibility.

[ChangeLog][qmake] qmake will tell the compiler that source code is
encoded in utf-8 by default. This mainly has an effect on Windows, where
MSVC still assumes source code is encoded in the current ANSI code page.
Use CONFIG+=no_utf8_source to get back the Qt 5 behavior.

Change-Id: I6dcafcaeefdea7d3907ccb723aeb7d23ccc0f04f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 19:14:51 +02:00
Giuseppe D'Angelo
9e1dc1e8a9 QStringView: add converting constructor from array-like containers
Centralize, rather than keeping adding constructors from any
array-like container.

A more robust implementation, likely following the converting
constructor for std::span ([span.cons]), is out of scope for C++17
and will require C++20's ranges and concepts.

[ChangeLog][QtCore][QStringView] QStringView can now be constructed
from any contiguous container, as long as they hold string-like data.
For instance, it's now possible to create a QStringView object
from a std::vector<char16_t>, a QVarLengthArray<ushort> and so on.

Change-Id: I7043eb194f617e98bd1f8af1237777a93a6c5e75
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-05-14 12:19:47 +00:00
Giuseppe D'Angelo
594abde1a2 Enforce that statically allocated array-like containers have 0 capacity
It has been the case for both QStringLiteral and QByteArrayLiteral
since Qt 5.0, and Q_ARRAY_LITERAL since Qt 6.0.

Since it's definitely surprising, add a note in the docs, which
is "somehow" consistent with the interpretation of capacity as
the biggest possible size before we reallocate. Since it's 0,
any manipulation of the size will cause a reallocation.
(Alternatively: the capacity() is for how many elements memory was
requested from the free store. No memory was allocated, so 0...)

Task-number: QTBUG-84069
Change-Id: I5c7d21a22d1bd8b8d9b71143e33d537ca0224acd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 14:19:47 +02:00
Alexander Volkov
af3caa2271 QBasicDrag: Send QDragMoveEvent when modifiers change
... without moving the mouse.
This allows to update drop action and cursor.

Task-number: QTBUG-56218
Task-number: QTBUG-82934
Pick-to: 5.15
Change-Id: I8b0ac2a008a9dbcc4c2d6abce282e6f169c2f542
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-14 15:19:47 +03:00
Lars Knoll
45ed28a9d3 Remove QRegExp from QVariant
Add an operator QVariant() to QRegExp to keep things at source compatible
as possible.

Add a hack to QVariant::load/save() to recognize the old typeid
for QRegExp and stream them correctly as long as the streaming operators
for QRegExp are registered.

Also move the datastream test for QRegExp to tst_qregexp, and adjust it to
the qvariant changes.

Change-Id: I120b38a7541b43ec07a21b17f7f35c55f071eb75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-14 12:19:47 +00:00
Lars Knoll
b2ee684a13 Remove QRegExp support from QString and StringList
Replacement methods do now exist in QRegExp, or
for QRegularExpression when porting to it.

Remove all autotests associated with the old methods.

Change-Id: I3ff1e0da4b53adb64d5a48a30aecd8b960f5e633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 14:19:47 +02:00
Lars Knoll
7370b60cfe Move methods using QRegExp in QString(List) over to QRegExp
The prepares for the removal of those methods from QString and
QStringList. The new methods in QRegExp are left as a porting help.

Change-Id: Ieffa33a79caf53b83029e9b070c4eb5cadca1418
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-14 14:19:47 +02:00
Marc Mutz
7a3a9b8eb5 QStringMatcher: port internals to QStringView and char16_t
Change-Id: If540b094d003ad373d3c581e1de8c526ad4c7d73
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-14 14:19:47 +02:00
Qt Forward Merge Bot
76fe36645e Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I06396fa0a3d1687a0935e48d290358edbb0e59e8
2020-05-14 14:01:32 +02:00
Marc Mutz
d68f3a81c9 Small fixes for the Q*Ref deprecation stuff
- don't force the deprecation sentence into a separate memory location
  (gives the compiler more leeway in how to lay stuff out)
- split the switch (will be useful when extending)
- fix a spelling mistake in one of the messages

Change-Id: Ied137dc8eee7047177983660e1a6776a0bf46bde
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-14 08:20:45 +02:00