Commit Graph

45592 Commits

Author SHA1 Message Date
Lars Knoll
8d89402435 Fix warnings about size_t to uint truncation
Use size_t for the internal hashing in QTextFormat to be
in line with QHash.

Change-Id: I210ab1622225f8e435d22e27ee7f730a4522ebe7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-05-02 21:32:05 +02:00
Lars Knoll
8292e3c590 Fix compile error on iOS
Change-Id: I776967c5d69e8d2d318fb2670e401d4ee3dccb67
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-02 18:53:03 +02:00
Marc Mutz
343ba5f0a9 QUrlIdna: avoid QString creation
Change-Id: Id05eecfcb1e170920c05fb0c7f17e46f039b4dee
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-02 07:30:44 +02:00
Marc Mutz
8fea227f30 QUrl: optimize fromAce()
Change-Id: I255b8c806e1386f654c372e8a327ca7aef1b610a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-02 07:30:30 +02:00
Marc Mutz
84aad0ab7b QUrl: avoid QString creation in setHost()
Change-Id: I7c55fc6c5b0194a2d77428f70f5a3053768b3d43
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-02 07:30:21 +02:00
Marc Mutz
13bea13792 QUrlIdna: port qt_ACE_do() to QStringView
Change-Id: I29abc17576ceb72dd678e3ca59456e6220acd0a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-02 07:30:10 +02:00
Marc Mutz
2e69375616 QUrlIdna: port nextDotDelimiter() to QStringView
Change-Id: I4fec88be2dacadcbb72927b973a51e1ead178c88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-02 05:29:58 +00:00
Marc Mutz
f3449b4d0a QString: replace a few autos with char32_t
(under protest)

Amends 4ba25a0920.

Change-Id: I5d5eecd9196fff34ac008bcb0213f476ccbb1155
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-02 07:29:18 +02:00
Joerg Bornemann
b530ddf795 CMake: Write QT.XXX.plugin_types to qt_lib_XXX.pri files
This is needed for building Qt plugins with qmake against other
CMake-built modules.

Change-Id: Ibd6ad0b08645c798be74285b24f71add947bea88
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-01 19:11:57 +02:00
Alexandru Croitor
29bb6311e3 CMake: Add some missing MinGW defines
Task-number: QTBUG-83929
Change-Id: Iaa12f1f8652cb132bead91160a2898657de52edb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-01 19:11:41 +02:00
Alexandru Croitor
27aeb30b5d CMake: Limit warnings_are_errors flags to C++ and Objective-C++
Otherwise when applied to bundled 3rd party library C files,
the MinGW build fails when compiling src/3rdparty/md4c/md4c.c.

Change-Id: Ia522b10aa69aa15f239d20c65e31c84edbccee6d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-01 19:11:37 +02:00
Alexandru Croitor
c85b393023 CMake: Fix developer build of MinGW cmake configuration
qmake is not warnings clean, so don't add -Werror.

Change-Id: I7a823241ded56967c1b802203f404ee36ed26429
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-01 19:11:33 +02:00
Alexandru Croitor
a876ff1283 CMake: Fix failing standalone tests on Windows
Due to the install prefix being changed for standalone tests,
the correct $qt_prefix/bin folder was not added to the PATH
environment variable when running tests.

Make sure to always include the the original qt install prefix,
even if a different install prefix is specified when configuring
standalone tests.

Amends 39090ea15c

Change-Id: I22aab732bb2bb679074a811d28d8209e1d535df3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-01 19:11:29 +02:00
Alexandru Croitor
88f6087f01 CMake: Use NAME_MISMATCHED in find_package_handle_standard_args of ECM
Gets rid of mismatch warnings when looking for various
ECM packages like XCB.

Change-Id: I0bf4db993195993df7789c032454b7883e8efd35
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-05-01 19:11:25 +02:00
Alexandru Croitor
f2ae9b3baa CMake: Adjust instructions for MinGW builds
Don't do any of the MSVC-related instructions when targeting MinGW.
Make sure to pass gcc and g++ as compilers when targeting MinGW.
Don't use any ENV_PREFIX that sets up the MSVC environment.

Task-number: QTBUG-75578
Change-Id: Icf5c39b58391d473d914fe8dc17d062812b07df1
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-01 19:11:22 +02:00
Alexandru Croitor
c571cb71a7 CMake: Fix 32 bit Qt builds like our MinGW config in Coin
Enable sse2 and fpmath for modules when appropriate, the logic
is a port of the code in mkspecs/features/qt_module.prf.

Fix qdrawhelper.cpp to always be compiled when using GCC with a
special case. pro2cmake.py failed to handle the source subtraction
correctly.

Fixes: QTBUG-83791
Task-number: QTBUG-75578
Change-Id: Ibe32a250b266d580ad21f6c55f09fd03a14ceb82
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-01 19:11:17 +02:00
Lars Knoll
be04ee67de Correctly flag remaining chars for the ICU codec
This will help us get rid of an extremely ugly hack in
QTextStream, where we copy the state.

Change-Id: If3e15eeb4e35c8607be54dd11c09ddfed87a4d93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-01 18:53:21 +02:00
Lars Knoll
0a02a598a4 Read XML as utf-8 not latin1 if we don't have codecs
99.5% of all XML documents in the world are encoded in utf-8, not in
latin1.

Also fix the tr() methods to use fromUtf8() in line with the Qt6
policy that source code should be in utf8.

Change-Id: Ie8744786185de839bfa5c9853b7bc36e36af293a
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-01 18:53:03 +02:00
Lars Knoll
5e5085c3bb Remove QTextCodec dependency from the xcb plugin
Change-Id: I4b6a7352ff86b40ac5c6b118f29f630a7f9e3a7e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-01 18:52:35 +02:00
Lars Knoll
4db2f067f1 Force the ibase plugin to use utf8
Firebird supports utf8 properly since version 2.0
(released some time before 2012), so force the client
encoding to it, and remove the QTextCodec related code.

Remove pre Firebird 2.0 code paths at the same time
and add an assertion to test that we have recent enough
client APIs.

Change-Id: I4c23e23f2fb1b4f550eaca63c47587fe9aaf3a6d
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-05-01 18:52:15 +02:00
Lars Knoll
8ab3b54fb7 Always assume utf8 for the client connection with the mysql server
The code was already trying to set the client charset to utf8. Enforce
this further and issue a warning if it fails.

Remove the text codec dependencies and directly use to/fromUtf8().

Change-Id: Ib75e46aaf0d1a274f6832b19eb38623a5cae5eb3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-05-01 18:52:15 +02:00
Lars Knoll
52053a8994 Remove useless code
We don't rely on a latin1 locale anymore for the test,
and the other code was not doing anything.

Change-Id: I08bc08d200c9e037884d8b680dfbb24c129f3d2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-05-01 18:52:15 +02:00
Lars Knoll
55dc178271 Remove QTextStream dependency from tst_qfile
Change-Id: I83cb05da8c094185b50e9cedea2e705ad1c7f948
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-05-01 18:52:15 +02:00
Lars Knoll
5acc3dd242 Remove a couple of QTextStream usages
Don't use QTextStream to write a QString to a file in UTF-8.
This can be done more easily, by directly converting the
QString to utf-8 and calling write on the io device.

Change-Id: I4b617b342ab339affb396ed49c5a920985d1ddfd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-05-01 18:52:14 +02:00
Lars Knoll
a308df82ae Don't use a QTextStream to write the trash info file
Using a QTextStream to write the file is probably around
50 times slower than simply creating the required string
here and writing it.

Change-Id: Ia848e4ad2688f098c671938d7ad9aaa4764a4158
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-05-01 18:50:10 +02:00
Lars Knoll
42d2d70abe Remove textcodec codepaths in qmake
They were anyway unused since years

Change-Id: I559b5042f6b942d7a940ac374d2b2740f2d4dc12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-01 18:50:02 +02:00
Ilya Fedin
38337fa9d3 Fix URL opening in snap sandbox
For some reason, snapd doesn't allow dbus activating of xdg-desktop-portal and returns AccessDenied to any request. Qt checks the returned error and if it is not ServiceUnknown, Qt doesn't try to open URL through xdg-open, which encounters into situation that URLs doesn't open until some other app tries to access xdg-desktop-portal.

Fixes: QTBUG-83837
Change-Id: I9e600f734401bd4295d97e2b5686b916c6c7f762
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-01 20:03:06 +04:00
David Faure
f0ea852d4d QCommandLineParser: Wrap very long option names to leave room for descriptions
Fixes: QTBUG-79926
Change-Id: I3302e0ed5b58949a35ccb001c71b22a6400a6c81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-01 10:53:55 +02:00
Nico Vertriest
a426326e99 Doc: Make snippets Qt Widgets compilable
Removed mainwindowsnippet.cpp and widgetdelegate.cpp
from snippets.pro

Task-number: QTBUG-81497
Change-Id: I40d1f34e64d958d2fb857dc8e468b9c40fff527c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-05-01 06:44:07 +02:00
Mårten Nordheim
cacac863e7 Set QT_PLUGIN_CLASS_NAME also on public plugins
... and update handling of CLASS_NAME in qt_internal_add_plugin

Change-Id: Iec8e5f9f80df02c9ba21648535872988839f4b64
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 17:44:21 +00:00
Mårten Nordheim
6ffe9b1c42 pro2cmake.py: Generate .cmake.conf files for versioning
And create one for QtBase at the same time.

Fixes: QTBUG-83835
Change-Id: Icc6b022165a57bd4e22c23bdb0016522b99a5b80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 17:44:03 +00:00
Simon Hausmann
709648993c Fix crash when using QProperty<T>::setBinding(Functor ...)
We must move the functor properly into the binding object, otherwise we
end up with stale pointers as pointed out by ASAN.

Change-Id: Icd84f4c113dd48e1e3e2d744abac0902cdf9339e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-30 19:39:42 +02:00
Simon Hausmann
0c4bc39002 Minor cleanup for QProperty constructor
Declare it inline

Change-Id: If8fe72a1f8e8e8af387d9bc3a2f731d61eda02cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-30 19:39:37 +02:00
Simon Hausmann
818de32db2 Attempt to squeeze unionized fake qproperty members even further
... by using the [[no_unique_address]] attribute, if available, instead
of the union.

Change-Id: Iab4db7039f1140a0005c7dd2fb6e08597ceec8f5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-30 19:39:32 +02:00
Simon Hausmann
3d7265db90 Provide a way of exposing private QProperties with a fake API
The API reduces the amount of manual plumbing required to offer a
conceptual property through the traditional setter/getter API as well as
through QProperty<T> API. Since the latter would require inlining the
type and thus making it impossible to add new properties without
breaking binary compatibility, this patch introduces a fake API that
behaves similar but does not contain the property by value.

Change-Id: Ib9bccd867f0e4e36a520e5583ba348e728284253
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-30 19:39:25 +02:00
Simon Hausmann
b480acb372 Allow for private properties to be implemented using QProperty
Recently the moc learned that Q_PROPERTY(int x ...) can mean that "x" is
implemented as QProperty and then allows installing bindings, etc. -
this works by scanning the same class' members.

For our own use of QProperty, we need to place the QProperty member
itself into the d-pointer to be able to maintain the ability to add new
properties without breaking binary compatibility. That however means
that moc can't know that a certain property is backed by QProperty - we
don't scan the members of the private class.

As a workaround, this change enables the syntax where the property type
used in Q_PRIVATE_PROPERTY may be wrapped with QProperty<T>.

In addition this patch fixes the compilation of such declared properties
by ensuring the accessor prefix (t->$accessor) is applied also for the
QProperty related meta call variants.

Change-Id: I8fbdc49319048b57f4eb0b65b56daba0459e9598
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-04-30 19:39:19 +02:00
Qt Forward Merge Bot
94fe42a753 Merge "Merge remote-tracking branch 'origin/5.15.0' into 5.15" 2020-04-30 18:04:07 +02:00
Qt Forward Merge Bot
5ed024a5da Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I1b46a9485d86f4d8ea104df31366fb6ad16a4654
2020-04-30 18:03:53 +02:00
Mårten Nordheim
382577419a QNAM/QNetConMon: Update handling of QNetworkConnectionMonitor::start
QNetworkConnectionMonitor::start was previously called after checking
d->networkAccessible, unfortunately that means if the network was
unavailable when QNetworkConnectionMonitor was created we don't
subscribe to updates or recheck the status (unless
QNetworkAccessManager::networkAccessible() is called).

Move the call to start to before the offline check. Also update the
Windows backend so that it updates networkAccessible on the call to
start()

Pick-to: 5.15
Change-Id: I37647f19f703947143e7cbdafe09619ce0d98cc1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 14:48:56 +00:00
Tor Arne Vestbø
ebc3350be7 pro2cmake: Translate (QT|QMAKE_USE)_FOR_PRIVATE into PRIVATE_MODULE_INTERFACE
Fixes: QTBUG-83063
Change-Id: I5b02cd236ef0fd3a9ed389294c05f8e3024463cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 14:20:26 +02:00
Tor Arne Vestbø
4618fa6f8d Fix pro2cmake help text
Change-Id: I84980dda981c50da159e4bb81b08190b882d6978
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 14:20:26 +02:00
Tor Arne Vestbø
3452874727 macOS: Remove copy of QT_IGNORE_DEPRECATIONS
It lives in qcompilerdetection.h now.

Change-Id: I7eb227b2a66997a7fd9e439a6dd21f398820f012
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-30 14:20:26 +02:00
Tor Arne Vestbø
c9d9ac5bb0 Don't reference build directory in helper lib pri
Otherwise the helper-lib pri file will be unusable when installed.

Change-Id: Id79a61e6ca9bb1b32c82ee158fd18f51319c484e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-30 12:20:26 +00:00
Mårten Nordheim
90012f12b0 QNAM: Don't check if a session is needed for a cache lookup
QNetworkAccessCacheBackend didn't override the virtual start() function
which then deferred to QNetworkAccessBackend::start() which conditions
its success on whether or not a network session is available.

Override the function and reimplement it without the network session
check.

Fixes: QTBUG-83205
Change-Id: I45d98a6f5da8ad04bb9da551a131f109e83074d7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 13:55:03 +02:00
Mårten Nordheim
8e4c32857d QAuthenticator: make sure we load the SSPI library
Change-Id: Iac371065dfc20ad5920889be66c8282a45c5805e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 13:45:55 +02:00
Edward Welbourne
c78a960198 QCOMPARE: treat values as equal if qFuzzyIsNull(each)
We hope this shall avoid some flaky failures noticed in quick tests,
e.g. tst_QQuickMenu::Material::subMenuPosition(cascading,flip) was
recently seen failing with 3.88e-11 != 0. This required some revision
to test data in the testlib selftest for floats; the resulting
expected output differs in details but not in which tests pass or
fail. QEMU, naturally, made life difficult, requiring special-case
code in the test-driver.

[ChangeLog][QtTestLib][QCOMPARE] QCOMPARE() now treats its values as
equal when qFuzzyIsNull() is true for both of them.

Change-Id: Icc6ad5164b609937eddbe39cc69120f0abf0f3b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-04-30 13:44:08 +02:00
Thiago Macieira
821e71fded QCborValue: check parsing of invalid URL
QUrl will reject invalid URLs for us, so we don't get normalization. The
original junk should be retrievable, of course.

Change-Id: Ibdc95e9af7bd456a94ecfffd160610f5b2c8e1a2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 08:01:28 -03:00
Thiago Macieira
8366c06d46 QCborValue: add tests of parsing invalid ISO date-time strings
We rely on QDateTime::fromString being proper, so this is not extensive
testing.

Change-Id: Ibdc95e9af7bd456a94ecfffd160610cdac5d62e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 04:01:05 -07:00
Thiago Macieira
2a53017df4 QCborValue: add an extra check against producing invalid ISO dates
By QCborValue design, we store the textual representation in ISO format,
equivalent of CBOR tag 0, which isn't allowed to have negative years or
beyond year 10000.

Change-Id: Ibdc95e9af7bd456a94ecfffd16060ccff359c296
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-30 04:00:47 -07:00
Thiago Macieira
52a2505672 QCborValue: avoid signed integer oveflows when decoding time_t
QDateTime::fromSecsSinceEpoch() multiplies by 1000 but does not check
for overflow. That means we must do so in QCborValue validation. We
can't use mul_overflow<qint64> on 32-bit platforms, so we do a compare-
and-branch there. For 64-bit platforms, we prefer to do the
multiplication with checked overflow, as the common case is that it will
not overflow and we'll need the multiplication anyway.

Change-Id: Ibdc95e9af7bd456a94ecfffd16060cba6f1c86b8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 11:00:29 +00:00