The non-versioned one's do miss some properties. It's therefore best
to not advocate using them.
Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When linking static libraries, MSVC's link.exe complains about
the unknown parameter "/INCREMENTAL:NO" and output a lot of warning
messages about this. This doesn't happen when it's linking exes
or dlls.
The situation is a lot more worse when we are using clang-cl.
clang-cl will print some error message like it can't find a
file named "/INCREMENTAL:NO" and just stop compiling. It seems
clang-cl treat unknown parameters as input files.
Fixes: QTBUG-87875
Change-Id: I37ed29de082b0258e81494db54f275417ab42708
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The tst_qtimer::zeroTimer unit test was relying on
QCoreApplication::processEvents processing all pending
events. However, for the glib backend, this is not the case.
For the glib backend, if there is an event of high
priority pending, low priority events are not processed.
This patch changes the test to use the overload with
timeout of processEvents, which does process events
until there are no more events or the timeout is reached.
Fixes: QTBUG-84291
Change-Id: I429141507b8603b57a191efa21f154493d75cc9e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This change allows the user to use -Wextra-semi-stmt without a warning.
A macro should never include a ; by it's own. Macro Q_UNUSED already
adds semicolon.
Fixes: QTBUG-82978
Pick-to: 5.15
Change-Id: I6d8d009cf89f0c8bbb6a9fee986e81302ebd7459
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The compiler can generate better code when the base is known
in integer to string conversion. This patch creates separate branches
for known bases and leaves generic code as a fallback.
Saved about 12ns per conversion of 12345678 in one measurement.
Task-number: QTBUG-87330
Change-Id: I44c9bb467cf211f7e617ed55104476062296bba6
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Adds SIMD acceleration for the blend_pixel, and raw interpolate methods,
and cleans up other SIMD code.
Gives minor speedups in text rendering and various fallbacks.
Change-Id: Ib0ad8b408450e4e73f3c1d50e9caaed0098acb94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QT.<module>.DEFINES assignment in pri files needs to take into
account the module name when computing the define name. This is the
MODULE value that qmake specifies.
In CMake that would be the value of CONFIG_MODULE_NAME.
Previously the value of the define was computed in
qt_internal_module_info() without taking into account the module name.
While qt_internal_module_info() ended being used also for plugins and
other target types, the defines computed by it were meant to be used
only for Qt modules.
Thus remove the <result>_define assignment from
qt_internal_module_info and move its computation directly into
qt_internal_add_module, taking into account the value of
CONFIG_MODULE_NAME.
The only other use of module_define was in qt_internal_add_plugin but
that was merely a long overdue copy-paste error, qmake doesn't
propagate QT_FOO_LIB defines for plugins.
As result, a define special case in testlib is not needed anymore,
because the define is now computed properly.
Finally, QT_FOO_LIB should not be used while building the Qt module
itself, so instead of using PUBLIC_DEFINES option of
qt_internal_extend_target, use target_compile_definitions(INTERFACE)
directly.
Change-Id: I4d44f7461bac2f0c09aec3e995d02dfe36e00883
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Since QPA plugins own the input device objects that they create, they
can also subclass to add arbitrary extra data (as was done with
QWinTabPointingDevice in abb5f0d376);
so this pointer seems unnecessary. It's unused so far AFAIK.
Retaining it also brings up the possibility of a memory leak:
~QInputDevice() doesn't delete it, and whatever code stores something
there would need to make sure it gets deleted.
Change-Id: I7ec264c23c74b83db1f37f64f31857caf551fdae
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Since the QVariant types are deprecated in Qt6, use QMetaType instead
Change-Id: I7bddea15a3f1a534d3c6f6b9e7ddf9585a8423bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Makes the diff between Qt 5.15 and 6.0 easier to read, to see what's
missing.
Change-Id: Idf8aa17b3ab8494f6855c172665423a53ca8a024
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The CONFIG_MODULE_NAME option to qt_internal_add_module is used to
specify what the name of a Qt module's pri file should, as well as
some of the key names assigned in that file, as well as what should be
passed to QT += in qmake projects.
When it is not specified, the computed value is the lower case of the
CMake target name. E.g. for qt_internal_add_module(Core), the computed
CONFIG_MODULE_NAME is 'core'.
The qmake variable that determines the above value is the MODULE
variable.
If it is not explicitly assigned, it's computed from the .pro file
name, rather than from the TARGET variable value.
Thus there is an inconsistency in how the value is auto-computed in
CMake compared to qmake.
We had a few special cases in projects that assign a correct
CONFIG_MODULE_NAME when the auto-computed value was wrong.
Teach pro2cmake to detect these inconsistencies and pass a correct
CONFIG_MODULE_NAME value based on the .pro file name. This way
we get rid of the special cases as well.
Aka if there is no explicit MODULE assignment in the .pro file, and the
auto-computed value by CMake is different from the one computed by
qmake, explicitly write out a CONFIG_MODULE_NAME value with what qmake
would have computed.
Task-number: QTBUG-88025
Change-Id: I166b29767e87cd6b0c681fa53238098355a177f9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In preparation for some further regeneration.
Also modify pro2cmake to add forgotten mapping for the
Qt::EglFsKmsGbmSupportPrivate module.
Change-Id: I92425c566c2b275b40eec8c652496290754ac385
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
ScreenPrivate::updatePrimaryOrientation() depends on the geometry
being set which is calculated by updateHighDpi().
Move the call up.
Amends 370289bef6.
Task-number: QTBUG-76902
Change-Id: I8188e04ad4a2ef7d414a2b78ecb3dd6c64528fa6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d10c34b0cc896c711fce8ae5629e3cc3d74b6452)
Many code paths simply expect to have a native interface
available, and won't check if a plugin is returning nullptr
for it. This leads to crashes or local workarounds
(e.g. 3197932e6f). Instead,
have offscreen implement a dummy native interface.
This requires shuffling some code for the X11 integration.
Pick-to: 5.15
Change-Id: I2bdceee379e4ded9b085ebbb4d03d1e074f60726
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Make hidden friends. Also add noexcept.
No documentation to adjust.
Fixes: QTBUG-87978
Change-Id: I6e757b7c37fb8aabdfd395ab057a84696104e640
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
CMake builds are special and need to know the path to the source dir.
This is handled automatically by QTEST_MAIN, but tst_qapplication
doesn't use QTEST_MAIN. Thus we need to call
QTEST_SET_MAIN_SOURCE_PATH manually.
Task-number: QTBUG-87137
Change-Id: Ib2c461f0da0a3d9a2f571f37476b750a606065f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Make them hidden friends, add a private isEqual helper where needed.
Adjust and add documentation.
Fixes: QTBUG-87976
Change-Id: If7c19eeab5be7452364eb76193981100f5516d6b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Mark routines returning new QImage as [[nodiscard]] and make inlining
consistent.
Change-Id: I76b6045cfef69498d74d86c38dca2331000dd219
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Make them hidden friends, follow up on
72ccb4fa7b which did the same for QVersionNumber.
Also add [[nodiscard]].
The operators are not documented, so nothing to adjust. Adding documentation
should be done in a separate commit.
Task-number: QTBUG-87973
Change-Id: I65e889a2d0a222f3318b77965e84f3220f1542c7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Amends 3afd06cd43, member comparison operators
are const.
Change-Id: I10d1da4faabb6cfd528fc653ff138ab8878b32b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Make global operators hidden friends. No change to the member-operators.
Task-number: QTBUG-87976
Change-Id: If7b08a30700d4e2f1a304d4b6cc4b5d02ee5e251
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The documentation states that QDate::fromString() accepts negative
year numbers, but it did not. This patch adds support for negative
year numbers to QDate::fromString() and corresponding unit tests.
Furthermore, tests are added for positive signs (+) in date strings.
Fixes: QTBUG-84334
Task-number: QTBUG-84349
Change-Id: I575291e7b8317055d4bb530011d7b10c9cd37ae1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The following MR in upstream CMake makes sure that the autogen targets
depend on the CMakeLists.txt file associated with the autogen target,
as well as any files it includes.
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5166
When doing a no-op reconfiguration in the build dir (call 'cmake .')
we used file(WRITE) to prepare the contents of a file to be used with
configure_file() for creation of a .qrc resource file.
Because this file was always rewritten on reconfiguration, its
timestamp was newer than then autogen target's timestamp which caused
the autogen targets to-be rerun, as well as some compilation and
relinking.
To avoid this, instead of using file(WRITE) ship a template file next
to the Qt6CoreMacros.cmake file, and use it as a template for the qrc
configure_file() call. This ensures that a reconfiguration doesn't
necessarily rebuild things it shouldn't rebuild.
Amends 113f1ad324
Task-number: QTBUG-88004
Change-Id: Icd95b28ca3642434cf21e5c49dcbd1ec65d76252
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
- Remove the casting operator of QFuture<T> to T. It calls
QFuture::result(), which may lead to undefined behavior if the user
has moved the results from QFuture via QFuture::takeResult() before
trying to do the conversion.
- Disable implicit conversion of QFuture<T> to QFuture<void>, by making
the constructor explicit. If the users really intend to do the
conversion, they should do it explicitly.
[ChangeLog][Source-Incompatible Changes][QFuture] Implicit conversions
of QFuture<T> to T and to QFuture<void> have been disabled. Use
QFuture::result() or QFuture::takeResult() where you need to convert
QFuture<T> to T. Use the explicit QFuture<void>(const QFuture<T> &)
constructor to convert QFuture<T> to QFuture<void>.
Change-Id: I153d4137d36365b1611ac934fb3ac2eb667fdd6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Comparing QVariant's containing QDBusArguments does not work anymore in
Qt 6, where QVariant will simply use QMetaType equals. Thus we now do
the comparisons in a more manual way. This is currently only partially
implemented.
Additionally, adjust to changed warning message.
Fixes: QTBUG-87998
Change-Id: Ie63db4e8c8d03d7627234f3c892067d1557454af
Reviewed-by: Liang Qi <liang.qi@qt.io>
So far, the internals of QDateTimeParser and especially the handling
of 'Intermediate' values were only tested implicitly by
tst_qdatetimeedit. 'Intermediate' values are values which
are not valid according to the specified format, but could
become valid by adding more characters.
This patch adds unit tests which tests parsing of
these intermediate values directly.
These tests will help implement handling of negative
year numbers, where additional complications arise
because of possible ambiguities between the minus sign '-'
and the separator '-'.
Task-number: QTBUG-84334
Change-Id: Ia6ba08df198288b8b11d3b2d2052c194f04fe8a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Test runWithPromise with "then" and "onCanceled" handlers.
Test the case when QFuture::cancel() is being called when
the task's thread already started, so that a call to
QPromise::isCanceled() from inside the running thread
returns different values in the same task's run. This nicely
proves that communication between QFuture and QPromise
works between different threads.
Task-number: QTBUG-84868
Change-Id: Icb2e0b1f99e2dcd919d881515f1ccd08e2f25b8c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We do not have host-specific INSTALL_*DIR variables in the CMake build.
It is equivalent to a qmake build with host prefix = prefix.
Change-Id: I65731e6038508b6c28e3f2819b624ba19abfc82a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The value of this variable must be exactly "mkspecs" or end with
"/mkspecs".
Change-Id: I39f83e9660794dfe23f5fd39fb1084b87ba1f140
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The value of this variable - whithout the mkspecs part - is what's
called the host data dir in Qt5.
Fixes: QTBUG-87681
Change-Id: I3dfeed17e8a614476aef4d9c651a141ce62e6551
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We must escape backslashes in CMake code that's to be evaluated and in
the arguments we read from config.opt.
Change-Id: I65d033c77f71888974983aa3d834acb2fe89f3fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Passing arguments with equal signs was broken for configure.bat and
qt-configure-module.bat. An argument FOO=BAR was split at = and written
as
FOO
BAR
to config.opt, breaking every attempt of assigning CMake variables.
We must not iterate over %* in batch files to avoid splitting arguments
at equal signs. Instead, pass %* unmodified to a CMake script that
writes config.opt.
Fixes: QTBUG-88019
Change-Id: I7c743a206961d1ed168f2313f864905f6b345b49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In a subsequent change we will call another CMake script from
qt-configure-module.bat. Write the location of qtbase/cmake into the
generated scripts instead of the path to QtProcessConfigureArgs.cmake.
Change-Id: Ie333b16d310b215c6e49efa27740c7525453d28f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Makes them member methods instead of hidden inline, as those actually
gets listed in documentation, and two were already documented as such.
Task-number: QTBUG-87975
Change-Id: I382ff8b701753f1fe150a38f4c530a52c98ad292
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>