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>
-Qt OpenGL is part of Qt 6.0 and graphics offering
-Edited introduction
Task-number: QTBUG-87155
Change-Id: I1581d5d962c62a3731d77e4e4dd58154257dc1fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Also move the porting section for QFuture and related classes after the
section for view classes, to make the order more natural for reading.
Change-Id: I5ea816d7bb3dfdda2b74112418bf07954c9ec94c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Add documentation-specific variants of lvalue/rvalue-this
overloads that QDoc manages to parse as separate entities.
Document begin() and cbegin() iterator getters in one go.
Task-number: QTBUG-86295
Change-Id: I2768dc6525bbf067e1597aa12e2e727f6d9fc35a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
- Fix linking to CMake manual.
- Remove references to the state machine framework.
Task-number: QTBUG-86295
Change-Id: I01a61088da8eb36760949f39be5e71d92de956f2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Having the string '*/' appear in a quoted snippet ends the entire
documentation comment. Use a parameter to the \code command to
work around that.
Task-number: QTBUG-86295
Change-Id: Ifcb21a4a0958724ebdb1c9e0eafdc767020d3a7b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
CMake considers ON/OFF as booly string values regardless of the case.
Make the value comparison in QtFeature.cmake case-independent.
It's now possible to build Qt with '-DFEATURE_gui=off'.
Fixes: QTBUG-87948
Change-Id: I3d948e8219ad9728414803c8c4cd756034073b46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
It can happen under unspecified conditions, see relevant ticket.
Task-number: QTBUG-86285
Pick-to: 5.15
Change-Id: I1f77bf0061a0faaa60283bb93fc3d82031247d54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reduce ADL noise. The operators are not documented, so nothing to adjust.
Change-Id: I02a8bdad6138758106283495098c72770ea74e52
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These operators don't do what the user might expect and may lead to
confusing results.
[ChangeLog][Source-Incompatible Changes][QFuture] The comparison
operators of QFuture have been removed. They were comparing the
underlying d-ptrs instead of comparing the results (as the users
might expect), which is not very helpful for the users point of view.
Change-Id: I80a887610eac38b60329128cca52cdb5fb515207
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
For the comparison of a QFuture<int> and an int, gcc creates code that
creates a qfloat16 instance, as can be seen when stepping through this
code:
QFuture<int> future;
int five = 5;
if (future == five)
return five;
Explicitly get the result of the QFuture to compare as a workaround.
Change-Id: Id2adc2268dbc0ccec7df3a9786c9d29dcdc04da3
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Previously we determined if a library represented by an absolute path
is a Qt module by checking if it's located in the build dir of the
current repo.
That is not sufficient for non-qtbase prefix builds, where
a Qt module might link against both a module in the current
build dir and in the prefix dir.
Detect such cases, and rewrite the absolute paths to relocatable paths
(either framework flags or paths starting with $$[QT_INSTALL_LIBS].
This should fix building examples with qmake that use QtQuick.
Fixes: QTBUG-87840
Change-Id: Icaf8f1a7c66292c80662fd0d5771a5a1628a9899
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Requires subsequent re-numbering of the enum tables to eliminate gaps,
before locale data can be regenerated. However, it will work with the
present locale data, since it merely loses the means to use some names
for which the available data was just the name and code. This implies
a transient issue of recognising some codes for which there is no
actual enum member; but relevant code will work as before, finding
nothing but the code and its name. This shall be resolved by a coming
BiC change to resort the language, country and script codes, changing
the numbering (almost) completely.
[ChangeLog][QtCore][QLocale] Various obsolete language and country
codes have been removed. Some lacked locale data, others were obsolete
aliases. All have been deprecated in 5.15.
Task-number: QTBUG-84669
Change-Id: I45fc76a5f2f6c3b0ea3c1bb61e917da984183783
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
CMake's --install --strip command will result in calling ${CMAKE_STRIP}
after installation.
On the build machines we have multiple compilers, and ${CMAKE_STRIP} will
have a valid program e.g. C:/strawberry/c/bin/strip.exe
This will change the MSVC binaries to have a MinGW linker version flag,
which confuses Qt Creator when setting up a MSVC Kit.
Amends 2044992eed
Fixes: QTBUG-87735
Change-Id: I1b3d4cc122b3f502810d48e0443f39824016cab5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Also for QByteArray::FromBase64Result, to reduce ADL noise.
Add explicit overload for comparison with nullptr to avoid
ambiguous overload errors with '0' comparisons.
Change-Id: I7ff9dbc90581707856c10cf7fb835175dfcdb55e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We can't assume that the number of arguments we get from GetCommandLine
will match what we have from argc, as the former is not wildcard
expanded on MingGW.
mingw64 will ask __getmainargs to expand wildcards depending on
the mingw-specific variable _dowildcard. By default this is set
to 0 (false), but some mingw64-packagers (msys2, mingw-builds)
pass --enable-wildcard during build, changing this default. As
a result, the arguments we get through argc/__argc have already
been expanded. MinGW does not reflect this through GetCommandLine
though, like MSVC does, which triggered the assert.
Amends dff18b8e80.
Pick-to: 5.15
Fixes: QTBUG-67515
Task-number: QTBUG-84002
Change-Id: Ib87961c6901d2894b48ba0f5b9a3d6da2a595f24
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>