Commit Graph

46029 Commits

Author SHA1 Message Date
Volker Hilsheimer
ac419a66fd Fix deprecation warning, use char16_t instead of quint16/ushort
Change-Id: I4021abb901260c3e27cefd81b3acd5ac198941c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-08 14:01:41 +02:00
Topi Reinio
2df31c8f2e Doc: Update global documentation config for Qt 6
- Set base URL path to /qt
- Define 'qt6' for use in conditionals
- Omit \since information for everything introduced
  before Qt 5
- Make use of the new expandable variables to allow
  component-specific URLs in commercial templates
- Adjust CSS for changes in QDoc's output

Change-Id: I74581f0fb49cd176f92d6451c388e7b7ddf1baa4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-06-08 13:41:07 +02:00
Martin Jansa
a85c7342ad Make the QFontCache size configurable
It can be configured using the QFONTCACHE_MIN_COST
define when configuring Qt.

Change-Id: I41fb781099c4c0f03c378f10c8db4ea06ef4e9ff
Task-number: QTBUG-83127
Reviewed-by: Risto Avila <risto.avila@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-06-08 13:23:21 +02:00
Lars Knoll
38096a3d70 Implement first/last/from and slice() for string-like classes
These methods are scheduled as a replacement for left/right/mid()
in Qt 6 with a consistent, narrow contract that does not allow
out of bounds indices, and therefore does permit faster
implementations.

Change-Id: Iabf22e8d4f3fef3c5e69a17f103e6cddebe420b1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-08 13:17:32 +02:00
Marc Mutz
6ec41bd550 QSsl: port a local QStringList to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

The code is the first user of the collected data, so make that
available by adding QDuplicateTracker::appendTo(Container&) methods.

Change-Id: Ibd8810c0070db7e6b3ead6d6a569facdab88b646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-08 10:53:20 +00:00
Venugopal Shivashankar
48b1bc48f1 Doc: Style the \section3 and \section4 titles
This should help visually differentiate between
the section titles and the normal text.

Change-Id: I5594aac0e0036509e7397999c3df21a90d474d60
Fixes: QTBUG-82694
Pick-to: 5.15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-06-08 10:51:09 +00:00
Fabian Kosmale
3f5b5e4859 Use static function instead of lambda to workaround a MSVC compiler bug
The seemingly useless template parameters are needed to avoid a
(distinct) bug in MSVC 2019 < 16.6, and should be removed once we have a
newer version in the CI.

Task-number: QTBUG-82945
Fixes: QTBUG-83600
Change-Id: I5b22a2259aa16ae90eca7d4f3bd2e4fa1116a73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-08 12:49:01 +02:00
hjk
de389229fa Example compile fix with namespaced Qt
This uses the "unneeded #include" approach, as this looks less
ugly than the QT_{BEGIN,END}_NAMESPACE decoration.

Change-Id: I03b6cf3ebf464134fe78ab49cbbad70c0b5fd42a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-08 09:35:16 +02:00
JeongBong Seo
ea86f19319 Add the 'accessiblebridge' as a plugintype of gui module
This patch makes the 'accesiblebridge' plugin configurable.

Change-Id: I99f01fcd434be25bbbe5460bbc8cc1d76aa744b9
Task-number: QTBUG-83126
Pick-to: 5.15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-06-08 09:34:02 +02:00
Eskil Abrahamsen Blomfeldt
3279c8e7d7 Move some flaky text tests into Lancelot
There are some slight differences between normal drawText()
and QGlyphRuns/QStaticText for decoration widths in certain
fonts. We decided to accept this and tried working around it
in the test by using ForceIntegerMetrics (since the difference
is < 0.5 pixel). This enum has been deprecated, so we move
the tests into Lancelot instead, since the idea here is to
test for regressions, not to compare the two painter commands.

Note that there is something off about decorations with
drawGlyphRuns() and drawStaticText() which is exposed
(not caused) by this, perhaps related to using a matrix
for positioning, since that was untested before.

This also takes the liberty of moving the emoji test string
from text.qps, since this was not in the statictext.qps yet.

Change-Id: Ib2d697095cbd11829cdd50b3c0268c85e9607c78
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-08 06:45:49 +02:00
Tasuku Suzuki
69795835f3 Fix build without features.menubar
Change-Id: If7ad6f4c50936d2abf8b88859cb3a8a6189df152
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-08 10:30:44 +09:00
Marc Mutz
bd465695c3 QWindowsFontDatabase: replace a QPair with a dedicated struct
Pairs are easy to use, but they have no semantics attached: Two
QPair<QString, QString> compare equal, e.g., even though one is used
as a FontAndStyle and the other as, say, a type/subtype. It also
carries no information for the reader of the code.

So, write a minimal struct with equality and qHash() instead.

Change-Id: I9514c9b7d6c2cc6a4831f9ca83ca2ee466d91553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-07 22:43:37 +02:00
Christian Ehrlicher
e0fc998e87 ItemModels: remove deprecated functions
Change-Id: Id3430493a62b11977f64e146f7668ca30935b959
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-07 19:02:47 +02:00
Samuel Gaist
50ccd35fbd Doc: add missing PatternSyntax documentation to QSslCertificate
This patch adds the missing documentation for the new QSslCertificate
PatternSyntax enum which replaces the one from QRegExp.

Fixes: QTBUG-84464
Pick-to: 5.15
Change-Id: Icf092f42ad4dff9207ca51dfd8b4fb8ed6443ff2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-07 16:23:41 +02:00
Christian Ehrlicher
32b586864e QAbstractItemModel: remove deprecated setRoleNames()
Remove setRoleNames() and all its now unneeded helper functions.

Change-Id: I0a83751aace35700655d4cc7c79278325994cbdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-07 10:01:48 +02:00
Oliver Wolff
45b0f1be68 Remove winrt
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.

Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-06 20:25:49 +02:00
Lars Knoll
aa81b90738 Remove unused argument from method
Task-number: QTBUG-84635
Change-Id: I9a1789e0481977e9fa26a915ff3bc776d0a37e75
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-06 17:19:02 +02:00
Lars Knoll
3615a5813a Remove unused function pointers in QVariant::Handler
Task-number: QTBUG-84635
Change-Id: Icfbd1aae26b0453426d93e0af64d84d6403b8e3b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-06 17:19:02 +02:00
Marc Mutz
ccbf6ae0bb QDir: port from QStringRef/split() to QStringView/tokenize()
Port away from random-access of the returned sequences. That's
neither necessary nor does it make the code more readable than
the alternative single-pass implementation used here.

As a drive-by, make applying NRVO more likely by re-using the
`result` variable for all returns after its declaration.

Change-Id: I2c3bbaefa6b6f08ebf0b90fb7be62e3c6243f19d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-06 13:43:04 +02:00
Giuseppe D'Angelo
1f80d1a5eb QVariant: use std::addressof instead of operator&
Change-Id: If7172e9e0e213d99f0c54b387dde8f9e163109d0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-06 13:30:34 +02:00
Giuseppe D'Angelo
725c37ffe0 QVariant: move and swap in the move assignment operator
And not pure swap. As per policy, QVariant must leave the rhs empty.

Change-Id: I2d5e0f584c4d4fffd05a0a5bfae27ddcb72430e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-06 13:29:49 +02:00
Giuseppe D'Angelo
c0f7ecab20 QVariant: remove UB and fix semantics in a test
The code was reading from uninitialized memory when creating a
variant. Fixing that reveals that the test semantics
are broken: when dealing with datatypes without a registered
operator==, QVariant resorts to memcmp, so the two objects
would've actually compared equal. Amend that.

Change-Id: I36bad7ee6a45154d5d534b7dd8b618cc0a900126
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-06 13:29:34 +02:00
Dmitry Shachnev
f133b226cd qmake: Stop using -isystem flag
This option changes the order of include paths, which can cause problems
of various kinds. See https://bugs.debian.org/958479 for an example.

The benefit of that option is minimal for what it was intended.

Pick-to: 5.15 5.12
Change-Id: I80eeabd09764df290b60bc59aeb2f90d07723608
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-06 09:53:59 +00:00
Marc Mutz
ee63557112 QString/View: add tokenize() member functions
[ChangeLog][QtCore][QString, QStringView, QLatin1String] Added tokenize().

Change-Id: I5fbeab0ac1809ff2974e565129b61a6bdfb398bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-06 02:07:28 +00:00
Tasuku Suzuki
832d3b482e Fix build without features.cborstreamwriter
Change-Id: I970d21d7ac97a602a5f374f6c89cd4bfdcd847b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-06 07:46:33 +09:00
Jean-Michaël Celerier
35608c0761 cmake: quote paths to prevent issues when no install prefix is set
Change-Id: Ifa7f1ef70c4893e10cb4ce9a54d8a0806d19be93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-05 20:57:32 +02:00
Allan Sandfeld Jensen
999c79863c Remove QThreadPool::cancel()
Deprecated in 5.9

Change-Id: Ib6e2a5da1e7ee2664fb6fa496bdc880fab870901
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-05 20:57:32 +02:00
Volker Hilsheimer
458d49861f Fix check for malformed input when decoding translations
Any integer modulo 1 can never be anything else but 0, so the statement
could never be true. The intention is to abort in case of an odd number
of bytes, as this would indicate malformed input that can't be decoded
into a QString.

Note that QTranslator will then silently continue to search for valid
translations, and not print any error message at runtime, or otherwise
inform the user or developer that an input message file contains
malformed content.

Change-Id: I957b337ee035f3aca013e0859f8ee70553d9a97b
Coverity-Id: 11014
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-06-05 18:57:31 +00:00
Eskil Abrahamsen Blomfeldt
a389001710 Fix compilation of lance tool
The QLayout::setMargin(x) call has been deprecated since Qt 5.13.
It was an alias for setContentsMargins(x, x, x, x) so we just
replace it with that.

Change-Id: I1c89eebfe776e0e3c8d0bdc19244bd452db4ef3c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-05 14:26:41 +02:00
Edward Welbourne
5ba44d1427 Clean up docs of qbytearray.cpp's C-string functions
Details of MSVC version became irrelevant some time ago; the code now
just tests for MSVC. In any case, the reader doesn't need to know how
the function is implemented, as long as it does what it claims to do.

We do not, in fact, use a random number source when generating the
return value for comparisons involving only one nullptr; we quite
consistently treat the nullptr as less than the other string. Make
explicit that this is true even if the other is empty.

Change-Id: Ifd9b00fdf8e814fcf933a05821201670fecfd646
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-05 13:58:30 +02:00
Marc Mutz
94ad8518e0 Include qstringtokenizer.h from qstring.h
It's a bit annoying that you have to include <QStringTokenizer> to use
the tokenize() methods. The separation is a historic artefact, just fix it.

Change-Id: Ied4cc0c8dd2bb6735bf29fbb26fdbf47d07db264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 13:21:45 +02:00
Marc Mutz
1f3cf206f4 QFactoryLoader: port a local QStringList to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

Change-Id: I0a0d1e31fd35d483e0036045847a3759b593c71c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-05 13:19:35 +02:00
Tor Arne Vestbø
1cd7cbf617 macOS: Respect window type when determining main window status
Fixes: QTBUG-84405
Pick-to: 5.15 5.12
Change-Id: I3fc6b15b07a81e7e7e417a5767c2853083c13516
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-05 11:00:16 +00:00
Alex Trotsenko
ad117c5444 QProcess/Win: Fix build in debug mode
Suppress a compile warning:

io\qprocess_win.cpp: 623:101: error: format '%d' expects argument of ...

Pick-to: 5.15
Change-Id: I9ea94ddfc21afea5d1a78e264507a36435cce063
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-05 13:22:49 +03:00
Edward Welbourne
8a95404905 Clean out string/character mentions from QByteArray docs
In some places QByteArray does interpret bytes as characters and a
sequence of them as a text string; everywhere else, however, it now
refers to them as bytes.

Add a section to the class doc explaining how char* pointers are
interpreted; the handling of '\0'-termination is surely familiar to
most readers, but making it explicit provides contrast for the
explanation of there being no such special treatment of '\0' bytes
when a stard address and length are given.

Also mention in the class doc that interaction with QString is done
via UTF-8 encoding and can be avoided by defining a macro. Shorten, in
light of that, the description of that encoding where it appears in
affected methods.

In the process, clean up lots of phrasings.

Change-Id: Ic97dce4a20752e277eeab35a06737322b2074692
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:13:29 +02:00
Edward Welbourne
c5f22d1c14 Fix references to section in QByteArray class doc after title change
This amends commit 9dd8e655cd to fix the
various references to section {8-bit Character Conversions}, which is
now renamed {Character Case}.

Change-Id: I1f777ab359c616a1b12f05a12b1cd7397f3ccb18
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:13:17 +02:00
Edward Welbourne
5f8c6f1760 Rework testing of qstr*cmp() functions
Previously only qstr*icmp() were tested and the test data was sent via
QString and {en,de}coding. Use a local data-type to package pointers
to actual string literals for passing to these functions that take
them.  Fold the various tests involving null pointers and empty
strings into the general testing, removing from "singularity" tests,
and combine the remainders of those tests into a single test of
singular cases for QByteArray::ompare.  Move all these tests to
alongside the existing tests for QByteArray::compare.  Use nullptr
rather than 0 as the null string.

Change-Id: Ie6d01e839c330c2f960af4bcc95e5633539337d6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:13:05 +02:00
Edward Welbourne
262ab9944a Prune two un-needed #include files from qbytearray.cpp
The QByteArray code doesn't use QLocale or QString.

Change-Id: I60966ecad35fdaaef9930ba2746bf732fa9f3cd7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:12:51 +02:00
Edward Welbourne
c7420d9cb8 Create QLocale's default store if missing when setDefault() is called
A check to prevent crash-on-exit if QLocale::setDefault() was called
after the default store was torn down had the side-effect of causing
setDefault() to not record data if it was called before the first
access to the default store caused it to come into being.

Change the check to test that the default store has been destroyed
and, if not, create it if it doesn't exist yet.  This refines commit
4d6572aac0 (as modified by commit
11c5c078c7).

Fixes: QTBUG-83016
Fixes: QTBUG-83415
Pick-to: 5.15
Change-Id: Icbce9bd9c75d0258d403e2f90957561b5a18bdf3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-05 12:12:36 +02:00
Liang Qi
ee8ba0e0ca Revert "Disable tests with qemu-arm & developer-build configurations in the CI"
We don't want to have untested qtbase.

This reverts commit 3598ffcc26.

This change also skips two network tests on b2qt.

Change-Id: I5c6f5e19487775f0a1c0feafa5e085208cbf7e9a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-06-05 12:10:07 +02:00
Jarek Kobus
79fd1cb2c6 Reuse the non blocking implementation for blocking one
Replace the implementation of blockingMappedReduced():
after calling non-blocking version of mappedReduced() we are getting
the future object, so we may call in sequence result(), which
will block and return the result when the all tasks are done.

The same is done with blockigMapped(), which calls blockingMappedReduced()
with a custom reduce function.

Looks like with this pattern we can reuse the non-blocking version
for implementing blocking version of mapped / filtered methods.

Task-number: QTBUG-83918
Change-Id: I7f240cfbd04834d551ff79d717b72194a26996d7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-06-05 12:09:59 +02:00
Lars Knoll
c49728eb27 Port qmake from QStringRef to QStringView
Change-Id: Ie07a976cd3c634e04c8b9b1e0a6cacd4c2d94939
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 09:07:14 +02:00
Lars Knoll
690abaac0e Port QSettings from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: If2b5d8eb78ab5ca78d365f137d9680b1f0646c6b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 07:07:13 +00:00
Teemu Holappa
0c2508efb2 Add possibility to set QNX Screen pipeline value
The pipeline value is set by window property _q_platform_qnxPipeline.

Task-number: QSR-263
Change-Id: I13536936b2335a97a6eeb5a94c4e0f552308d15e
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2020-06-05 07:07:13 +00:00
Tasuku Suzuki
758ee12a99 Fix build without features.shortcut
Change-Id: I5b0d3b169c7adb3ee340df7b593f84167f1ccc0c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 10:23:48 +09:00
Tor Arne Vestbø
df2e029a06 macOS: Clean up headers
The headers are now C++ clean and can be used outside of Objective-C
code. All includes of Objective-C frameworks have been moved to the
implementation files.

Header guards have been added in the few places they were missing.

All includes are now done via #include, instead of sometimes using
the #import variant.

Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 00:03:51 +02:00
Tasuku Suzuki
c7d80486de Fix build without features.completer
Change-Id: Icaed1963d6306e36653d01ad9d05b68cb50717e5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 07:02:28 +09:00
Alexandru Croitor
2073a16497 CMake: Clean up AND NOT QT_BUILD_STANDALONE_TESTS in QtAutoDetect
Now that the whole file is not included when doing standalone tests,
the conditions are not needed anymore.

Change-Id: I49ddd2fc4a8327e09529948785f40cda5dedbb11
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:32 +02:00
Alexandru Croitor
dc26b30acd CMake: Protect against Qt toolchain file recursive inclusion
Three different people have encountered the issue that calling
calling qt-cmake on a project prints 1000 inclusion lines of the same
qt toolchain file, and then CMake bails out saying can't find the
CMAKE_MAKE_PROGRAM Ninja.

This happened because people accidentally called qt-cmake to configure
qtbase (instead of just cmake), which created a toolchain file that
chainloads itself recursively.

Error out when configuring qtbase, and when using the generated
toolchain file in the case when it would try to include itself.

The solution is to remove the qtbase CMakeCache.txt file, and
configure qtbase again, so it generates a proper qt.toolchain.cmake
file.

If somebody feels enthusiastic, they can move the check into the
qt-cmake and qt-cmake-private shell scripts, and error out before the
qtbase/CMakeCache.txt is polluted with the wrong toolchain file.
That is left for people that feel more comfortable with bash and batch
scripting.

Change-Id: If518c94791fe7c30731e6e462e347f26a5213c64
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-04 23:21:27 +02:00
Alexandru Croitor
c254254c55 CMake: Fix qmake mixing for framework builds
Include headers in .pri files should point to the framework Headers
dirs.

The module name in the .pri file is not versioned when it's a bundle.

Paths to system frameworks in .prl files should instead be replaced
with -framework Foo flags.

Change-Id: Ia353d033799fae40a1bc55fad6f86b2c8ef76c56
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:21 +02:00