Commit Graph

49128 Commits

Author SHA1 Message Date
Lars Knoll
b76fbb48fb Clean up out allocation handling
Get rid of the allocation options inside the flags
field of QArrayData, they are really a completely
separate thing.

Change-Id: I823750ab9e4ca85642a0bd0e471ee79c9cde43fb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:46 +01:00
Lars Knoll
419eaa0679 Cleanup QArrayDataOps::reallocate() and related
Don't use QArrayData::GrowsForward/Backward anymore and replace
it with a simple 'bool grow'.

Change-Id: Ifddfef3ae860b11dda4c40854c71ef2aeb29df34
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:41 +01:00
Lars Knoll
32a703e277 Don't move data in QArrayDataOps::reallocate()
reallocate() should only ever call realloc(), and only be used to
create more space at the end of the data.

Change-Id: I2ac4dbc90d2afaa571bb620108d7984356712cb2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-04 11:21:37 +01:00
Lars Knoll
50ec3252ac Do not move data around on insert neither
The while insertion logic will need further work to make it
more efficient. Currently it does use copy construction and
assignment for internal moving instead of move operations.

Change-Id: I7ae3094daa43a44629d8fa89ab6562c2a21b6cbd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:32 +01:00
Lars Knoll
90fadbb365 Remove the prepare call in QArrayData::appendInitialize()
It's causing a performance bottleneck and is not required anymore
after changing the allocation strategy.

Take the opportunity to change the signature from using size_t to
qsizetype.

Change-Id: I74ff1637007cf7072de80e7383a23fdfe1ccd986
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:27 +01:00
Lars Knoll
b99271caa6 Avoid expensive iterator calculations in append()
Avoid moving data inside the array to create free
space at one end. This is a performance bottleneck,
as it required quite a lot of calculations for every
insert. Rather reallocate and grow in this case,
so we only need to do expensive work when we reallocate
the array.

Change-Id: Ifc955fbcf9967c3b66aa2600e0627aac15f0c917
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-04 11:21:22 +01:00
Lars Knoll
e5f80c1b03 Remove unused parameter
Change-Id: Idceb7ee3ce752b62ed6800b0a1004832a4c48af7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:16 +01:00
Andrei Golubev
7eed57511a QArrayDataPointer: redesign (and simplify) growth policy
It looks like we can drastically simplify the way QADP grows without
sacrificing much:
1. append-only use cases should have the same performance as before
2. prepend-only use cases should (with the help of other commits) get
   additional performance speedup
3. mid-insertion is harder to reason about, but it is either unchanged
   or benefits a bit as there's some free space at both ends now
4. mixed prepend/append cases are weird and would keep excess free
   space around but this is less critical and overall less used AFAIK

Now, QList would actually start to feel like a double-ended container
instead of "it's QVector but with faster prepend". This commit should
help close the performance gap between 6.0 and 5.15 as well

As a drawback, we will most likely have more space allocated in mixed
and mid-insert cases. This needs to be checked

Task-number: QTBUG-86583
Change-Id: I7c6ede896144920fe01862b9fe789c8fdfc11f80
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:12 +01:00
Andrei Golubev
12718e5ea2 Add QList::emplaceFront() that fixes huge performance issue in prepend
Prepend in QList was using insert() logic that always uses append-aware
functions. This results in the fact that freeSpaceAtBegin() is always 0
and forces us to actually allocate on *every* call (with the same
capacity!). Vicious cycle is hot-fixable with introduction of
emplaceFront (or anything prepend-aware, really)

This brings me from 632ms to 0.65ms for 100k iterations of
list.prepend(int(0)). Still ~3x worse than QList in 5.15 but much
faster than QVector, which takes 382ms in the same workload

Not addressed:
- QString/QBA
- Other prepend functions in QList e.g. prepend(it1, it2)
- Lower-level array operations that should just be extended

Task-number: QTBUG-86583
Change-Id: Ie82b07d81a67605cd308d9fabf9532d57935647f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:06 +01:00
Andrei Golubev
02a5928fa5 Add QList/QVector benchmark tests
Added some simple benchmarks for QList insertion of 1 element

Added same tests for QVector (within the same file) for 5.15

Task-number: QTBUG-87330
Task-number: QTBUG-86583
Pick-to: 5.15
Change-Id: I19a851c79cf5ce0329266883e99ecaf2d6b3df19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:01 +01:00
Morten Johan Sørvig
4035fdd820 wasm: don’t deadlock on event processing
emscripten_async_run_in_main_runtime_thread_ schedules
an async call on the on the main thread. However, the
calls are ordered, also in respect to _synchronous_ calls
to the main thread (for example those made during file
write/flush).

Making a synchronous call from a secondary thread may
then cause Emscripten to service previously scheduled
async calls during the synchronous call. This can cause
a deadlock if:

- a secondary thread makes a sync call while holding a lock, and
- a previously scheduled async call attempt to acquire the same
  lock on the main thread.

(See https://github.com/emscripten-core/emscripten/issues/10155
for sample code)

Avoid this case by adding a second zero-timer async call;
this way Qt should process events when the main thread
becomes idle.

Change-Id: I221fe4e25bbb1a56627e63c3d1809e40ccefb030
Pick-to: 5.15
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-11-04 10:17:09 +00:00
Yuhang Zhao
f9e45287d8 CMake: don't add the same parameter twice
Change-Id: Ic5001f296b56f1181f5e37718e090f931eca8b50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-04 10:07:50 +00:00
Mårten Nordheim
319fa51fa4 QtNetwork: highlight DTLS client and server example
Change-Id: Ie6aaf0c15daaf63f9c7dd172c7a775d4076e4b16
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-11-04 09:59:09 +01:00
Sona Kurazyan
62a741cd2b Improve QtConcurrent::blockingMapped tests
QtConcurrent::blockingMapped was not able to determine the result
type in case of passing containers that have more than one template
argument. This should be fixed by the parrent commit.

Also fixed some unrelated compiler warnings.

Change-Id: I96618dc955c5e4c3792f28f6436d6851745dc01d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-04 09:40:12 +01:00
Allan Sandfeld Jensen
b26fa9722f Add multi key bindings to QShortcut
This makes it feature comparable with QAction, and makes it possible
to use as a backend for QAction, and fixes a few missing alternative
keybindings in qtwidgets.

Change-Id: Iaefc630b96c4743fc5ef429dc841870ddd99fc64
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-04 10:32:38 +02:00
Kai Koehne
8fa93272f0 Doc: Fix mentioning of Qt5Core in overview page
Change-Id: If6ae12117c95a6c843dfd93735590e17b8d2d2a3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-11-04 09:20:17 +01:00
Allan Sandfeld Jensen
02c2a58cdf Avoid allocation on char16_t* comparisons
Compare as QStringView

Change-Id: I151d17ac20da30266776ca369ca8221017174f84
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 08:58:26 +01:00
David Skoland
e674ee5328 Add quotes to cmake_args in guess_compiler_from_mkspec function
These were omitted in the original change, which cause cmake builds to
fail configuring

Change-Id: I37996099aaa0d912ce06b1f06c175cc5cf159e33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-11-04 08:08:19 +01:00
Volker Hilsheimer
255cc9abfb Initial porting guide for QtGui and QtPrintSupport
Additional porting documentation for QtWidgets.

Task-number: QTBUG-88149
Task-number: QTBUG-88151
Change-Id: Ia28f01a8d8d6eaee9d8f08af1a54b76e57620cab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-11-04 06:57:29 +01:00
Martin Storsjö
317145af84 qglobal: Only define QT_ENSURE_STACK_ALIGNED_FOR_SSE for i386
This define is only supposed to be used for i386, but was set for
any 32 bit mingw architecture (which also covers armv7).

Change-Id: Iedc057dfc493015e8339db837dbe20a57c2b2367
Pick-to: 5.15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 06:39:03 +02:00
Martin Storsjö
3e13fd43df cmake: Always add -Wno-ignored-attributes for clang targeting windows
This matches how it is in the qmake mkspec, silencing a lot of
warnings - but contrary to when building with qmake, it's only
applied when building Qt itself. For external projects built with
cmake, the Qt headers are included with -isystem, which silences any
warnings from those headers.

Change-Id: I1a498d3c2715cb73e647668cb7226ceeffb7ff0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-04 06:38:35 +02:00
Friedemann Kleint
6f8df4dac0 Fix link error when comparing QSslPreSharedKeyAuthenticator
QSslPreSharedKeyAuthenticator::isEqual() as accessed
by inline operators is not exported.

Amends 57e57d9bcd.

Change-Id: Ia0f0de81a371a31422d07af5b11f0db03265504e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-04 05:16:48 +01:00
Allan Sandfeld Jensen
de2b221ce8 Add noexcept to slicing and indexing of QStringView
None of those paths should be able to cast.

Change-Id: I947f26c0aae134076499c9f80e910b0257d2bc62
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 05:16:48 +01:00
Zhang Hao
bf5011815d InputMethod should call reset() function when proxywidget lost focus
fix When the preview of input Chinese appears,the proxyWidget
lose focus and does not call the reset method of inputMethod.

Fixes: QTBUG-88016
Pick-to: 5.15
Change-Id: I82a66207b0d2046d768430ac3e93df86c1ed3681
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-04 12:16:48 +08:00
Cristian Adam
68f3e37449 CMake Build: Enable separate debug info for all target types
Now all shared libraries and executables will get .debug files on
the platforms that support FEATURE_separate_debug_info

With the directory property _qt_skip_separate_debug_info certain
targets can retain the debug symbols in the binary e.g. lupdate with
MinGW 8.1.0 will cause objcopy / strip to fail.

Fixes: QTBUG-87015
Change-Id: I03b106e68ef0a42011d1ba641e6f686b2e7b7fb4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-04 01:41:06 +01:00
Shawn Rutledge
f6418343f1 Add QEventPoint::normalizedPosition() to replace normalizedPos()
In 4e400369c0 we deprecated
normalizedPos() because we suspect it's a legacy feature that few
users will need.  However Qt developers keep bringing up the continued
usage in autotests over and over.  (It's IMO not wrong to keep testing
deprecated functions in autotests, but the warning keeps attracting
attention.)

Of course it will turn out that normalizedPos() has users; we just
don't know how many.  One way to look at it is: why should they copy
a snippet of code to calculate it, when it costs us so little to
continue to provide this accessor.

It might also turn out that some users will complain that in Qt 5
it was passed through from the device driver (or at least from the
window system API) to the application, and perhaps the replacement will
not always work, for example if availableVirtualGeometry() ends up
wrong, or there is some strange scenario that generates events that are
out-of-bounds for the device that the event professes to come from, so
that the "normalized" coordinates also go outside the [0..1] range.
We reserve the right to put back the storage in QEventPointPrivate if
the need arises; so that's why this function is not inline.

We continue to hope that startNormalizedPos() and lastNormalizedPos()
are used even less and won't be missed much, because it would be
wasteful to store them all the time if only a few users need them.

Change-Id: I23ed78843e3f9e16133c5b6f462884a3845f91b6
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-03 20:36:35 +01:00
Martin Storsjö
46dd4df4b9 cmake: Set a warning flag based on the target arch, not build host
Change-Id: I0b524d52286210b7782dd710467fbc3a742d0c08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-03 21:36:35 +02:00
Fabian Kosmale
d3ed7dac8a moc: Handle include in enum, take 2
The existing logic broke down when we reentered the enumerator parsing
loop, and encountered a INCLUDE_MOC_END token in the first handleInclude
call. Fix this by restarting the loop in that case.
Amends d8a2456fbf.

Fixes: QTBUG-88125
Pick-to: 5.15
Change-Id: I87acaa986a81de53730eddc40bc7d48c15328aba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-03 19:36:34 +00:00
Volker Hilsheimer
ca85d3370f Remove left-over and unnecessarily exported operator==
Amends a45a3b1ece

Change-Id: If481ec1818ec4cb263f271f0099f7452fbdce1a0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-11-03 20:36:34 +01:00
Volker Hilsheimer
5ea1f40350 Deprecate QFontDatabase constructor
Move private methods into the private class.

Fixes: QTBUG-88114
Change-Id: I92fa52980ed5a0675eee310359d8875f614921e6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-11-03 20:36:34 +01:00
Volker Hilsheimer
a50f0f045d Get rid of all instance usage of QFontDatabase
All QFontDatabase APIs are static, use them accordingly.

Task-number: QTBUG-88114
Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-11-03 20:36:34 +01:00
Shawn Rutledge
488e72cce8 Update third-party md4c to version 0.4.6
If you try to parse markdown containing null characters, it should not
crash anymore.

[ChangeLog][Third-Party Code] md4c was updated to 0.4.6.

Pick-to: 5.15
Fixes: QTBUG-87965
Change-Id: I6e0ac6f4ecb41c0836f22c7a6a2d510102c933c0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-03 20:36:34 +01:00
Alexey Edelev
dc43061e9a CMake: Add handling of user-defined INPUT_foo cache variables
"configure" script translates feature-related parameters to INPUT_
variables instead of FEATURE_.

Both INPUT_ and FEATURE_ variables passed to cmake script are
equivalent. FEATURE_ has higher priority in case if both are defined.

Fixes: QTBUG-87755
Change-Id: If697a0d62ab839877a3196ea74e631582a570dda
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-03 16:28:14 +01:00
Lars Knoll
f8c30759d9 Make the QMultiHash(const QHash &) constructor explicit
And add a QMultiHash::unite(const QHash &) method to avoid
a copy of the data when inserting a QHash into a multi hash.

Change-Id: I864aa9d2b9b7b2c367c3c4d140a2ce2f5408ae09
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-03 16:28:14 +01:00
Lars Knoll
a9c52dbdf4 Fix qHash(QMultiHash)
The old code was trying to convert a multi hash to a QHash. While
that worked in Qt 5 it won't compile in Qt 6 anymore.

QHashCombineCommutative also can't be used with a std::pair.
ADL won't find the correct instance with a namespaced build,
as qHash(std::pair) is defined after QHashCommutative. Fix
the code to compile and work correctly.

Change-Id: Ice2bc3ab4244e310cbbb5e0f31fc11eb14f5faf3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-03 16:28:14 +01:00
Lars Knoll
ba1266baec Use variadic templates to generalize MapSequenceResultType
This helps us determine the correct result type for std::vector, as
that one has two template arguments and would otherwise not get
caught here.

Change-Id: Ie887088bce25df2cadc8422a4212dc33d57ecfa5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-03 16:28:14 +01:00
Lars Knoll
5646f46ec9 Clean up container metatype declarations in QMetaType
Remove forward declarations, we have those already from qcontainerfwd.h.

Change-Id: I1b8a91ece912e6cdf747f4e2a750f0e85bcb5b2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-03 16:28:14 +01:00
Lars Knoll
089fc2df1b Clean up qcontainerfwd.h
Add missing declaration of QVariantList and friends. Replace
class with typename for template parameters.

Remove some left-over forward declarations in other headers.

Change-Id: I31d443019d48b619e02834395dafa40182cac7b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-03 16:28:14 +01:00
Lars Knoll
7d75a48507 Cleanup container declarations in qtypeinfo.h
Use variadic templates to avoid having to use several macros to
declare movable containers.

Add missing movable declaration for QCache.

Change-Id: I32d6a399ef8e6c39021df04deedfbbf0c526fc84
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-03 16:28:14 +01:00
Volker Hilsheimer
742de50c5e Address API review comments for QInput/QPointingDevice
- Give default constructor an optional parent, as is standard for QObjects
- remove default for QObject parent from inheritance constructor
- make QPointingDeviceUniqueId comparison inline, remove superfluous
inline of hidden friends
- mark read only properties as CONSTANT
- remove bit-size from enum types; they are stored in the private,
and there are just a few instances; no need to save a few bytes at the
expense of performance and code cleanliness

Change-Id: Ie7d4a587362714e9d3bc41447cef786bbdb382c6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-03 13:06:15 +01:00
Fabian Kosmale
a31dde22db QProperty: Fix notification logic for eager properties
This ensurse that we do not do dobule notifications in setValue.
Moerover we avoid needless notifications in markDirtyAndNotifyObservers
when the value did not change. Lastly, if the value did actually change,
we pass that information along to notify, so that we do not evaluate the
eager property twice.
Fixes a test-case which errorneously relied on the old behavior, and
adds a new test which verifies that the fix works.

Change-Id: I8ec6fa2fe8611565dfc603ceab3ba5f92999b26c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-03 13:06:15 +01:00
Fabian Kosmale
c1c991c319 Remove std::function from QProperty interface
std::function as a type is rather unfortunate for us, as its SSO buffer
makes it rather large, and we can ensure that the function is never
empty.
Considering that we do need to allocate memory for
QPropertyBindingPrivate anyway, we can get rid of the SSO buffer and
instead coalesce the allocations (similar to how std::make_shared works).
The memory looks then like
[--QPropertyBindingPrivate--][Functor]
and QPropertyBindingPrivate can get a pointer to the functor via
reinterpret_cast<std::byte>(this)+sizeof(QPropertyBindingPrivate).
To actually do anything with the functor, we do however need a "vtable"
which describes how we can call, destroy and move the functor. This is
done by creating a constexpr struct of function pointers, and storing a
pointer to it in QPropertyBindingPrivate.

As a consequence of those changes, we cannot use QESDP anymore, as we
now have to carefully deallocate the buffer we used for both the
QPropertyBindingPrivate and the functor. We introduce a custom
refcounting pointer for that. While we're at it, we make the refcount
non-atomic, as bindings do not work across threads to begin with.

Moreover, we can now make the class non-virtual, as that was only needed
to hack around limitations of QESDP in the context of exported symbols.

Change-Id: Idc5507e4c120e28df5bd5aea717fe69f15e540dc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-03 13:06:14 +01:00
Assam Boudjelthia
a95ddcf97b Android: fix crash by passing the right Handle to dlsym()
dlsym() should be taking a Handle that is created by dlopen() instead of
pHnd.

* https://linux.die.net/man/3/dlsym

Fixes: QTBUG-84849
Pick-to: 5.15
Change-Id: Ic192736268ef9cbfdb86cf66d20082b14070ba00
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-11-03 12:06:14 +00:00
Eskil Abrahamsen Blomfeldt
7d875b4306 Add deprecated accessors for legacy font weight
In 3558704ed5 we changed the font
weights to use the OpenType weights rather than our own
non-standard scale.

This can cause difficulty for people who have legacy font
weights stored as ints and no way to convert them. Therefore,
we add accessors for the legacy font weights to ease the
transition.

Change-Id: I2a591c62895dfa1a2310d9a2d0cdcf08de08f3a4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-03 13:06:14 +01:00
Joerg Bornemann
9a50d62039 CMake: Fix Windows top-level configure.bat
We must write config.opt in the same directory we're reading it from.
We must not write the -top-level argument to config.opt.
This amends commit 2a29426e39.

Change-Id: I96da9094579fec29c290411677d6b538878399f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-03 13:06:14 +01:00
Alexandru Croitor
72aab8b487 CMake: Bump the minimum required CMake version to build Qt to 3.18
Add a new function that returns the minimum CMake version required to
build Qt. Pass that value to cmake_minimum_required() when building
qtbase and its standalone tests.

The minimum supported CMake version is read from qtbase/.cmake.conf
and its value should be updated when the need arises. It's the main
source of truth for all repos.

Provide a way to lower the minimum CMake version at configure time by
passing a value via QT_FORCE_MIN_CMAKE_VERSION.
This is not an officially supported way of building Qt. If the
specified version is lower than Qt's supported minimum, show a
warning.

Nevertheless the option is useful for testing how Qt builds with a
different minimum CMake version due to different policies being
enabled by default.

Issue warnings for CMake versions that are higher than the minimum
version but are known to cause issues when building Qt.

A counterpart change is needed in qt5 to ensure the minimum CMake
version is set at the proper time for top-level builds.

Ideally we would use the same 'check the CMake minimum version` code
in all our repositories, but that will cause lots of duplication because
we can't really find_package() the code and doing something like
include(../qtbase/foo.cmake) hardcodes assumptions about repo
locations.

So for now we don't bump the minimum version in child repo
cmake_minimum_required calls (qtsvg, qtdeclarative, etc).
Instead we record both the minimum supported version and the computed
minimum version (in case a different version was forced) in
QtBuildInternalsExtra.cmake.
Then we require qtbase's computed min version in
qt_build_repo_begin().

This won't set policies as cmake_minimum_required would, but at least
it propagates what minimum CMake version should be used for child
repos.

We might still have to bump the versions in child repos at some point.

Task-number: QTBUG-88086
Change-Id: Ida1c0d5d3e0fbb15d2aee9b68abab7a1648774b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-03 13:06:14 +01:00
Lars Knoll
aaabdf8457 Rename QContainerTraits namespace to QContainerInfo
We'll need QContainerTraits as a class for changing properties
of our containers, so free up that name. This is not a problem,
as the namespace is new in Qt 6 and has only been used internally
so far.

Change-Id: I6d6b9d9c32b92b77e66323f1fc29b3ddd8baa98f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-03 13:06:14 +01:00
Mårten Nordheim
1776c0b40d QtTestLib: Update porting guide
Few breaking changes. Some things moved header, but as they didn't
change namespace, naming or signature, and the old headers now include
the 'new' headers, it is SC anyway.

Change-Id: I6b0556049f6d9203dcf7420317a14992fbe85a80
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-11-03 13:06:14 +01:00
Lars Knoll
df57e1ac65 Code cleanups
Mark constexpr booleans as inline.

Change-Id: Ib7e0f9d96ff3894b72dcd13c07643ef3b9e6e2c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-03 13:06:14 +01:00
Lars Knoll
d5e913cc60 Fix QDataStream compatibility for QTextFormat::TextUnderlineColor
The enum value of that property changed. Use the same mapping trick
as with two other properties to ensure backwards compatibility
in QDataStream.

Change-Id: I01b36f9ecbcaf40e7c8523da33ea4c8f12821a63
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-11-03 13:06:14 +01:00