Commit Graph

35937 Commits

Author SHA1 Message Date
Volker Hilsheimer
57e57d9bcd Hide comparison operators for QtNetwork value types from non-ADL
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>
2020-10-30 17:27:29 +01:00
Allan Sandfeld Jensen
d51d312c86 Cleanup qimage.h
Mark routines returning new QImage as [[nodiscard]] and make inlining
consistent.

Change-Id: I76b6045cfef69498d74d86c38dca2331000dd219
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-30 17:23:59 +01:00
Jarek Kobus
0cee264b3a Don't use pointers or references to functions from std library
Task-number: QTBUG-87719
Change-Id: I7331b7a0095fd41261173d309215f897542669ed
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-10-30 17:23:06 +01:00
Volker Hilsheimer
17848a667b Hide QTypeRevision comparison operators from ADL
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>
2020-10-30 16:19:27 +00:00
Volker Hilsheimer
8eabcc6170 Fix qdoc issues in QList
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>
2020-10-30 17:19:27 +01:00
Volker Hilsheimer
abc5b75d7f Hide comparison of QHostAddress with SpecialAddress from ADL
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>
2020-10-30 17:19:27 +01:00
Andreas Buhr
91140eb726 Adapt QDate::fromString() to accept negative year numbers
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>
2020-10-30 17:19:27 +01:00
Alexandru Croitor
2da301fe46 CMake: Fix unnecessary rebuilding upon reconfiguration
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>
2020-10-30 17:19:27 +01:00
Sona Kurazyan
4d9658b7cd Use universal references for passing callables in QtConcurrent
Task-number: QTBUG-87596
Change-Id: I219f08d73b97317820ec6e329ab1e6c89c0545f1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-30 17:19:26 +01:00
Sona Kurazyan
ff0ba7e2d7 Forbid implicit conversions between QFuture and other types
- 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>
2020-10-30 17:19:26 +01:00
Allan Sandfeld Jensen
48a13327c6 Add noexcept to QLine comparisons
Change-Id: Id75a8511c66d9fe23450043a9230f8dc8925be28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-30 17:19:26 +01:00
Allan Sandfeld Jensen
cfa3633025 Remove Q_IS_ENUM
Deprecated since 5.8 already.

Change-Id: I01ea32b5f4b922cecb18c5760a1b5fa49c4e54c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-30 13:27:56 +01:00
Allan Sandfeld Jensen
951274a9b9 Make QVarLengthArray comparisons hidden friends
Task-number: QTBUG-87975
Change-Id: Iaebb237b3d5d3e881caf9a93153e295af051e2ab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-30 13:27:14 +01:00
Andreas Buhr
b0d4d95a29 Add unit tests for QDateTimeParser internals
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>
2020-10-30 10:15:29 +01:00
Allan Sandfeld Jensen
3afd06cd43 Hide QList comparisons from ADL
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>
2020-10-30 08:20:16 +01:00
Topi Reinio
0575ff787a Doc: Fix documentation warnings for Qt SQL
Task-number: QTBUG-86295
Change-Id: Ia8c0daabcf79e56d51de801cb2be1b83bf03276b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-30 06:19:37 +01:00
Topi Reinio
afa341375d Doc: Fix documentation warnings for Qt OpenGL
Task-number: QTBUG-86295
Change-Id: I4fff2d61f8f0513181150954440c9357acf73c1d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-30 06:19:26 +01:00
Topi Reinio
ae347b23d6 Doc: Fix links to the CMake manual
Task-number: QTBUG-86295
Change-Id: I7b2208284d65ec9182352490bd4c92458c5e5e37
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-30 06:18:49 +01:00
Topi Reinio
803e7e0327 Doc: Fix documentation warnings for Qt Print Support
Task-number: QTBUG-86295
Change-Id: I8121f7c127896e57ec2e7636828af36bb83acfe3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-30 06:18:09 +01:00
Topi Reinio
0428383915 Doc: Fix documentation warnings for Qt Network
Task-number: QTBUG-86295
Change-Id: Ib8bcf0a6e2af8a589b44e56b19641f4d2fe6f800
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-30 06:14:46 +01:00
Allan Sandfeld Jensen
5b76be7e2b Fix two missing conversions from in to qsizetype
Change-Id: I08ac9a0eb5dfb17f2b6cfaca9e3f3d7375c02bd4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-29 21:59:31 +01:00
Jerome Pasion
133067085a Remove do-not-use warning in Qt OpenGL landing page
-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>
2020-10-29 21:31:53 +01:00
Allan Sandfeld Jensen
0cd134ed91 Make QMap and QMultiMap comparisons hidden friends
Task-number: QTBUG-87975
Change-Id: I3c84a188cdbb0d09e0e7c66588c7638c8a8328fd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-29 20:25:49 +01:00
Sona Kurazyan
e53a3bd85a Move porting guide for QtConcurrent to its designated page
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>
2020-10-29 20:18:47 +01:00
Topi Reinio
0526ae3f03 Doc: Fix documentation warnings for QIterable and related classes
Task-number: QTBUG-86295
Change-Id: I1d4c851ae7d2910ab6276ab2215b5f6e550a12c8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-29 18:38:08 +01:00
Topi Reinio
ecd86b1894 Doc: Fix documentation warnings for string classes
Task-number: QTBUG-86295
Change-Id: I13033635eecd495b32c98c7ec9318a0102b6f23e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-29 18:29:22 +01:00
Topi Reinio
59644dc9df Doc: Fix documentation issues for QStringTokenizer
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>
2020-10-29 18:28:00 +01:00
Topi Reinio
f604fe6d1d Doc: Fix link issues for QtCore
- 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>
2020-10-29 18:27:21 +01:00
Topi Reinio
13e978e827 Doc: Fix code snippet that abruptly ends the document
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>
2020-10-29 18:26:13 +01:00
Allan Sandfeld Jensen
b77cf10a4f Move QPolygonClipper to XCB native painting
It is the only code using it.

Change-Id: I30060a63b6621ea94ae487ec93cd857117e12a46
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-10-29 18:09:24 +01:00
Dimitrios Apostolou
743ffcbc82 Avoid doing kill(-1) in QProcess destructor
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>
2020-10-29 19:03:25 +02:00
Volker Hilsheimer
4d269b4561 qfloat16: make comparison and arithmetic operators hidden friends
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>
2020-10-29 17:52:26 +01:00
Allan Sandfeld Jensen
4c36d64bb3 You can't disable SSE2 for x86-64
Fixes: QTBUG-88013
Change-Id: Iec571ef3fccbec46145617ca8d983c3a333090e4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-29 14:20:03 +01:00
Sona Kurazyan
30a1683f65 Remove the comparison operators of QFuture
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>
2020-10-29 14:19:35 +01:00
Edward Welbourne
3a1bc4bad5 Purge deprecated language and country codes from QLocale
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>
2020-10-29 10:44:38 +00:00
Volker Hilsheimer
ec4079160a Make QByteArray comparison operators hidden friends
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>
2020-10-29 10:22:21 +01:00
Tor Arne Vestbø
4e08651bac MinGW: Fix assert in QCoreApplication::arguments() when passing globs
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>
2020-10-29 10:10:21 +01:00
Volker Hilsheimer
874eb19107 QStorageInfo: Make comparison operators hidden friends
Reduce ADL noise.

Task-number: QTBUG-87973
Change-Id: Ia8957e6452cdebac808ec2a20d475db448863149
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-29 09:48:52 +01:00
Volker Hilsheimer
7635d77689 Organize QtOpenGLWidgets documentation
Move snippets to the right place, and give the widgets class a place to
live.

QtOpenGLWidgets is just a library, not a separate module, but we need a
module page that the class can refer to for correct build instructions.

Change-Id: I6d955ad3c4cd1003a828cc1f256deb6e7fb50ec4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-29 09:48:28 +01:00
Volker Hilsheimer
61574ee963 Remove documentation for removed qHash overload
QPair is an alias to std::pair in Qt 6, so no need for two qHash functions.
Also remove note and snippet from std::pair overload documentation.

Change-Id: Ica8f6961af1eac493e909ad06fe46f8f68542bc5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-29 09:48:15 +01:00
Karsten Heimrich
173615222a Doc: Scrub QByteArray/QByteArrayView documentation
Fixes: QTBUG-86555
Change-Id: I3221e0de10e692ca767eeb69daa82da55b93e395
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-29 09:26:33 +01:00
Jerome Pasion
b961fb42e2 Change terminology to "look and feel"
-should be "look and feel"

Task-number: QTBUG-88010
Change-Id: Icd71c84e2331faa317a228cdbaaa82e7598b781f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-29 09:26:05 +01:00
Assam Boudjelthia
950e628fd8 Android: replace stacktrace with debug message in search for setActivity
Don't print stacktrace when setActivity is not found but only print a
debug message, QtActivityDelegate will continue to look for setContext
which might actually be a problem if not implemented.

Fixes: QTBUG-86733
Pick-to: 5.15.2
Change-Id: Iaf7f347ae04605a1f616f24d25cac4938c1640a4
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2020-10-29 08:00:05 +00:00
Assam Boudjelthia
90912b657e Android: disable Gradle caching by default
If enabled by default, the cache size will grow quickly, especially
if multiple different projects are managed every day. Keep the option
commented, which can be enabled manually by the user.

Pick-to: 5.15.2
Change-Id: I6d4a67f4f1bb3e37b02de7ff4c534ec4d006f9a3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2020-10-29 07:59:32 +00:00
Tapio Oksa
2ff546e030 [Android] Request cursor to be in proper position
Cursor were set to incorrect position (-1) causing first character overwrite in password field,
fixed by setting position to '0' for the first character

Fixes: QTBUG-85090
Pick-to: 5.15
Change-Id: Ia2333803d5fe8f274f1ad1a643e4ff5aa8556b81
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-29 07:54:38 +00:00
Volker Hilsheimer
7372dde4ec Math 3D classes: make comparison operators hidden friends
Reduce ADL noise from QVector2/3/4D and from QQuaternion. Also mark as
noexcept.

Task-number: QTBUG-87973
Change-Id: Id14fd17c0da43517766b218ed85c3b41f91b43c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-29 08:51:44 +01:00
Volker Hilsheimer
2222e695fc QMetaMethod: Make comparison operators hidden friends
Reduce ADL noise.

Change-Id: Ic747c2d76b7ce66b222e08eeaf6f1d193ba99f81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-29 08:51:26 +01:00
Volker Hilsheimer
5866b82e24 Fix documentation for QTest touch APIs
Change-Id: Ifd9a3161e8ee422f8b0ce3adba8ae1b029c096d1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-29 07:13:34 +01:00
Eskil Abrahamsen Blomfeldt
a332f3fabc Fix delay first time a font is used
Since 066daf750f, we would mistakenly populate the
fallback list for all ensureAt(index) calls, even when index == 0. This index
indicates the main font, is always valid and does not require knowledge of any
fallbacks.

On Windows (and other platforms where QPlatformDatabase::fallbacksForFamily() is used)
this would cause all fonts on the system to be loaded and should only be done when
we actually need one of the fallbacks.

With the GDI font database, in which font loading is slow because we have to manually
read font data, this is especially bad. If we can later move to using DirectWrite
for this, we should be able to improve on it, but in any case there is no need to
pay the cost of the fallbacks when the application is just using the fonts it has
selected (memory-wise this is also a bad idea). On my machine a simple text layout
went from 370 ms to 37 ms.

[ChangeLog][Text] Fixed an issue where on some platforms, there would be a delay the
first time any font was used, sometimes causing a visible delay in the UI.

Fixes: QTBUG-71737
Pick-to: 5.15
Change-Id: Ie8ce9b73f02a0e5cf39a2b280968b89f4caaf39e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2020-10-29 07:06:50 +01:00
Hiweed Mandriva
b75d60abd2 doc : remove redundant ')'
Change-Id: I84a1a08889e04b4d6a33384a3f91d5bf3976871c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Hiweed Mandriva <hiweedmandriva@163.com>
2020-10-29 10:47:16 +08:00