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>
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>
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>
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>
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>
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>
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>
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>
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>
QSslPreSharedKeyAuthenticator::isEqual() as accessed
by inline operators is not exported.
Amends 57e57d9bcd.
Change-Id: Ia0f0de81a371a31422d07af5b11f0db03265504e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
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>
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>
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>
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>
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>
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>
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>
"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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The flags go before the library in the final linker line, as opposed
to the dependencies declared in LIBS.
This allows us to declare the flags for the entrypoint
in the project file of the entrypoint, instead of in
a standalone prf.
Change-Id: I35c054fe9fdaa6add7cd0e8ba3f7304f975ff80f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Partial revert of 5866b82e24.
The function is still in the QTest namespace.
Change-Id: I5e25b405baf07e61781ca4a527601ef0bf8ce6a4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
On the qmake-side we had exports, but they were quoted.
Change-Id: I95af4b927079691cab6403fec850f345ba181a00
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>