Commit Graph

46912 Commits

Author SHA1 Message Date
Tor Arne Vestbø
57337f21c7 Add missing braces when constructing BigConvertible in tst_qvariant
Change-Id: Ia571e8950aa28721080dc7434921b79ffda913f4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-29 14:33:20 +02:00
Tor Arne Vestbø
f8d1e16da0 Add missing enumeration case in tst_QMacStyle::setSize
Change-Id: Iade36b03c6f8bdaa8feb82ef89744a399f92e21d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-29 14:33:19 +02:00
Tor Arne Vestbø
9b8695998b Add proper dependencies for doc snippets
On iOS the plugin is statically linked into the app. We need to wait
for the plugin library to build before we can build the snippets.

Change-Id: I79c89c5615f16d63a46c25481c9a40bf2b4a7eaa
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2020-07-29 14:12:54 +02:00
Tor Arne Vestbø
7fdb47862c iOS: Add Metal framework as dependency
Change-Id: I7d8d8cef8252a65378b24af1ade87bb484d5fa68
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-29 13:54:26 +02:00
Tor Arne Vestbø
19d32f0a5f Add QOperatingSystemVersion support for macOS Big Sur
Pick-to: 5.15
Pick-to: 5.12

Change-Id: Ide57f675b20b08210f301da5177df45d008423c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-29 13:25:28 +02:00
Tor Arne Vestbø
3e71e2e851 Fix build of testlib doc snippets
The file src_qtestlib_qtestcase was built twice,
causing duplicate main symbols

Change-Id: I18750b87eee27603d9f56129fd6c30fddf4a4828
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2020-07-29 13:22:12 +02:00
Oliver Wolff
e9056a5c0a Update sync.profile with recent module hierarchy changes
These platformsupport modules were moved into gui or opengl or
removed completely. They are no longer needed in sync.profile.

Fixes: QTBUG-85784
Change-Id: I5ca141c6f612bdd3e63c4eaf375b7ef2f6a1314c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-29 10:54:59 +02:00
Friedemann Kleint
ed114b728d Windows: Prevent event processing during QDesktopServices::openUrl()
The platform implementation uses the Win32 API ShellExecute(),
which may spin an event loop to do COM processing, causing things
like QMetaCallEvent being processed. Run it in a thread
to suppress this.

Pick-to: 5.15
Fixes: QTBUG-85676
Change-Id: I240ca78b41b39ded22e466662ffce8e9b03c10a2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-07-29 08:22:18 +02:00
Lorn Potter
44d4bc6d90 wasm: fix setTransferTimeout
WebAssembly does not need the http feature, but these functions were
hidden behind that feature.

Fixes: QTBUG-83867
Pick-to: 5.15
Change-Id: I7cd9aa73003f45ccbc2613c67c21e4067d6edddd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-07-29 09:09:03 +10:00
Lorn Potter
762b5f09a6 wasm: fix network headers logic
Fixes: QTBUG-85083
Pick-to: 5.15
Change-Id: Iaf0f3365ee20fe257f3edac0e1105bdfcc5ba0da
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-07-29 09:09:00 +10:00
Allan Sandfeld Jensen
d782df4861 Make qfloat16 helper functions consistent with float/double versions
Infinite is only when the mantissa is 0, everything else is NaN.

std::isnormal returns false on zero.

Pick-to: 5.15
Change-Id: I897fc0dc3b8a9c557bb1922ea7ca8df501e91859
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-28 18:12:07 +02:00
Thiago Macieira
f16613f7ef QLocale: fix conversion of "\0" to double
That is not a valid conversion. An empty string is a valid conversion; a
string containing a null should fail.

Change-Id: Iea47e0f8fc8b40378df7fffd1624c088f3bd1b14
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-28 08:54:06 -07:00
Thiago Macieira
f50945b8fd QLocaleData: remove unused internal function
Pick-to: 5.15
Change-Id: Iea47e0f8fc8b40378df7fffd1624bf3469e66c90
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-28 08:54:03 -07:00
Thiago Macieira
efd3c7bf24 QByteArray::toDouble: fix buffer overflow reads on fromRawData()
If Qt was not compiled with libdouble-conversion, sscanf() requires
null-termination, which fromRawData() does not require. This could be
fixed by making QByteArray pass a reallocated copy if it is operating on
raw data, but fixing qt_asciiToDouble() means we catch all cases and we
optimize for the common case of not-horribly-long strings.

Fixes: QTBUG-85580
Pick-to: 5.15 5.12
Change-Id: Iea47e0f8fc8b40378df7fffd16246f6163b01442
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-28 08:54:02 -07:00
Shawn Rutledge
c13ce05482 Export the QMutable* event classes
They are needed often in Qt Quick.

Change-Id: I8f68798042dd7440958c8bc2b8fe7021af8ec34d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-07-28 17:32:14 +02:00
Timur Pocheptsov
c9a702a04d QSslSocket (OpenSSL, Windows) - make sure we ignore stale fetch results
The CA fetcher on Windows works on a separate thread, it can take
quite some time to finish its job and if a connection was meanwhile
closed (via 'abort', 'close' or 'disconnectFromHost') but the socket
is still alive/re-used - we don't want to be fooled by the previous
fetch 'finished' signal, only if it's fetching for the same certificate.

Change-Id: Ibd0a70000ad10cff10207d37d7b47c38e615d0f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-07-28 15:35:41 +02:00
Friedemann Kleint
964f5757ea Windows QPA: Move some internal functions to the new interface
Move createMessageWindow(), the GPU detection for qtdiag and the async
expose setting (used by Active Qt) from QWindowsNativeInterface to
QWindowsApplication.

Remove unused registerWindowClass() and use logFontToQFont() directly from
the font database.

Task-number: QTBUG-83252
Change-Id: I9c72351970b47457d08125557c2580016c66e586
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-28 13:21:10 +02:00
Friedemann Kleint
2405aa9d67 Windows QPA: Move mime-type related classes to the new interface
Move QWindowsMime (which was a public class in Qt 4 and moved to the QPA
plugin in Qt 5) to the platform namespace and add register functions to the
native application.

Move in test code from QtWinExtras.

Task-number: QTBUG-83252
Change-Id: Iaac440e2d5cb370110919921b1eeb779600b5b65
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-28 13:20:23 +02:00
Timur Pocheptsov
904eaec9de QSslSocket (OpenSSL) - fix a minor type error
Change-Id: I76bf6c7d47c7d29228837bbb139a7f6a32de0e5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-07-28 12:38:30 +02:00
Timur Pocheptsov
1482739002 QHostAddress: resolve API issues marked with ##Qt6
Also, remove the deprecated function and its auto-test.

Change-Id: If04a54c4b91e0f76523960c7b1a5bcb8fe883ac6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-28 12:38:15 +02:00
Alex Trotsenko
83f00b8229 QNativeSocketEngine/Win: fix write() in case of splitting
When a first call to ::WSASend() consumes less data than requested, we
are trying to make a second call, leaving 'bytesToSend' unmodified.

Instead of setting a new value for 'bytesToSend', it seems reasonable
to break the loop, if the system buffer overflow detected.

Pick-to: 5.15
Change-Id: I8038e95c20221518955efe786f2d0dadb98360fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-28 10:40:18 +03:00
Fabian Kosmale
30395e9185 tslib: Add missing override annotation
Else developers fail to compile due to the newly added
-Wsuggest-override

Change-Id: I1fdcab794a8639a7cf2f6712e9ede6f25f7d3f69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-28 09:29:33 +02:00
Allan Sandfeld Jensen
f26147b493 Replace Q_ALWAYS_INLINE with static inline
Static inline on functions serves the same purpose of keeping non-
inlined instances from different binaries from being mixed, and has the
benefit of being available across compilers.

Change-Id: I12467f6d887471d8fd70ff4623c473c2a5a45664
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-28 08:39:42 +02:00
Peng Wenhao
59e3073b1c Close memory leak in QTestLib support for string to numeric testing
QTest::toString allocates memory by calling qstrdup; that memory must
be freed by the caller.

Change-Id: I9724db0c617884cf08592968b1411f002ef23204
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-28 13:36:31 +08:00
Giuseppe D'Angelo
b71c8eb386 QCompleter: fix an out of bounds access in a QMap
If the iterator points to the map's begin(), then one can't
decrement it. Split the check and the decrement.

Change-Id: I3d816f13d0bcacc8253ba6d223bc83c874e5efb5
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-27 23:02:33 +02:00
Thiago Macieira
a77c159044 QWindowsServices: ungarble the URL
QUrl::toString always encodes as UTF-8, regardless of what the local
encoding is. So this produces garbage on Windows (and any non-UTF-8
system, but those don't exist any more outside of Windows, by
definition). So use %ls to keep the UTF-16.

Task-number: QTBUG-85745
Pick-to: 5.15
Change-Id: Iea47e0f8fc8b40378df7fffd162584f98e5bd633
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-27 13:39:38 -07:00
Robert Loehning
188501fe27 Sanitize lengthValue in CSS parser
Limit the LengthData to the integer range before rounding it, taking
into account that qRound() substracts 1 from negative values.

Fixes: oss-fuzz-23220
Pick-to: 5.15 5.12
Change-Id: I1b4383f3c33aac22746831002b2c74fc134faf77
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-27 12:29:55 +02:00
Edward Welbourne
899a7e9158 Fix some compiler errors caused by bit-rot in manual tests
Two methods that have gone away or been renamed,
an enum that now doesn't support being assigned from int.
QTime should no longer be used as a timer.
Removed a test of deprecated code that's gone away.

Task-number: QTBUG-85700
Change-Id: Idc6d59542625d22b9937084411b54b0d8aa87f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-27 11:32:36 +02:00
Edward Welbourne
131f856bdd Move a comment from a header to relevant docs
QProcess::FailedToStart had a //### comment which looked distractingly
like it wanted some action, but it was really just documenting the
enum member. Removed the comment and updated the doc to reflect the
one fragment of information that the comment added.

Task-number: QTBUG-85700
Change-Id: Ibe11b91a998751ee9cdd3018cc6a3d8f3ab30eea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-07-27 11:32:27 +02:00
Edward Welbourne
4788bebcc8 Unify QLoggingCategory's two constructors
This follows upon commit ca0df4b2694fc3ca0c31cda0d5edec7e76f7dfcb's
comment requesting the unification. Tidied docs at the same time.

Task-number: QTBUG-85700
Change-Id: Ia12dbe98b94388030c7a06036c5287cfbcc4fd05
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-07-27 11:32:15 +02:00
Edward Welbourne
67f3c504b8 Inline QDir::separator(), as requested by a ### Qt6 comment
Task-number: QTBUG-85700
Change-Id: Icd44e428b607703defb9be1c149db6a564e6b4f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-27 11:32:05 +02:00
Friedemann Kleint
beb3916858 Windows QPA: Potential crash fix for Wine
Add a check for theme instance.

Pick-to: 5.15
Fixes: QTBUG-85734
Change-Id: I10aced73379cd5e0b49d5cee08ceead060397a54
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-07-27 11:30:12 +02:00
Edward Welbourne
37649b0942 Fix misplaced nullptr, used for a flag value
Task-number: QTBUG-85700
Change-Id: I34b1aa8430842d96eb515d709b49de4e60976ac9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-07-27 11:26:40 +02:00
Edward Welbourne
f4323889f1 QLine: purge deprecated API
Since 5.14: intersect(), angle().  Also removed definition of M_2PI
from test, since its last use was in the tests being removed.

Change-Id: Ie3a12247e3760e8bfdd3a659cd06245c86b198c2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-07-27 11:26:08 +02:00
Edward Welbourne
d3c8757731 Purge redundant recoding of URL fragments from QByteArray
QUrl::fromEncodedComponent_helper() only existed to support some old
methods deprecated since 5.0, that I recently removed.
It was the only caller of qt_urlRecodeByteArray() aside from that
function's own autotest.
Both were private.

Task-number: QTBUG-85700
Change-Id: I5d09fd44e768847ce51a1ae7043150922cb5314c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-27 11:25:49 +02:00
Edward Welbourne
f144507829 Clean up manual network stress-test
Don't attempt the remote test if we don't have a remote server.
Don't add error returns from read to byteCounter.
Don't cast from ASCII to QString in URL components.
Don't waste time encoding a path for which it's a no-op
(especially as I recently deleted the method used to do it).

Name the time-out, both for clarity and to give anyone who needs to
debug the test only one line to edit so as to increase the time-out
enough to make debugging practical.

Change-Id: I378aa96c0501f7033ca4abb82734b03b8c807f08
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-27 11:25:11 +02:00
Edward Welbourne
d6537b7aa5 QLine: eliminate M_2PI in favor of qmath.h's radian<->degree converters
Task-number: QTBUG-85700
Change-Id: Ib916af901df518f3a16b3d6d948384f25011f9f6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-07-27 11:23:30 +02:00
Edward Welbourne
197ba3e938 Inline QDir::separator(), as requested by a ### Qt6 comment
Task-number: QTBUG-85700
Change-Id: Icd44e428b607703defb9be1c149db6a564e6b4f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-27 11:21:00 +02:00
Edward Welbourne
02c2c930f0 Fix some compiler errors caused by bit-rot in manual tests
Two methods that have gone away or been renamed,
an enum that now doesn't support being assigned from int.
QTime should no longer be used as a timer.
Removed a test of deprecated code that's gone away.

Task-number: QTBUG-85700
Change-Id: Idc6d59542625d22b9937084411b54b0d8aa87f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-27 11:20:35 +02:00
Edward Welbourne
2059170b33 Fix misplaced nullptr, used for a flag value
Task-number: QTBUG-85700
Change-Id: I34b1aa8430842d96eb515d709b49de4e60976ac9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-07-27 11:20:14 +02:00
Edward Welbourne
07a5ab6c62 Unify QLoggingCategory's two constructors
This follows upon commit ca0df4b2694fc3ca0c31cda0d5edec7e76f7dfcb's
comment requesting the unification. Tidied docs at the same time.

Task-number: QTBUG-85700
Change-Id: Ia12dbe98b94388030c7a06036c5287cfbcc4fd05
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-07-27 11:19:59 +02:00
Edward Welbourne
953cca326d Move a comment from a header to relevant docs
QProcess::FailedToStart had a //### comment which looked distractingly
like it wanted some action, but it was really just documenting the
enum member. Removed the comment and updated the doc to reflect the
one fragment of information that the comment added.

Task-number: QTBUG-85700
Change-Id: Ibe11b91a998751ee9cdd3018cc6a3d8f3ab30eea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-07-27 11:19:30 +02:00
Tor Arne Vestbø
3251adb919 cmake: Add some air to configure summary
Change-Id: I3408957d8a81ac3080eac28e48dbafe9059e22f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-26 20:12:48 +02:00
Tor Arne Vestbø
9a8fe34e4d tst_qicon: Enable lowdpi test using qt_add_test argument
Change-Id: I98f850c668a45d127abb1c2af5915f2cbcbd1cdb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-26 20:12:47 +02:00
Sona Kurazyan
089d72d7d9 Clean-up methods with default values in JSON classes
Task-number: QTBUG-85700
Change-Id: I46e7c58e4cc94cf19cd9f11e03d2a498cd0c8922
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 18:47:08 +02:00
Sona Kurazyan
062bee3a2a Improve the iterators of QJsonArray and QJsonObject
Remove the fake QJsonValuePtr and QJsonValueRefPtr required for
operator()-> of QJsonArray and QJsonObject iterators.

Task-number: QTBUG-85700
Change-Id: I622a5a426edb13b32f9d00a02c3c148320fbccba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 18:47:01 +02:00
Tor Arne Vestbø
bd3088ceb3 Fix warnings about unused variables and functions in tests
Change-Id: Ia758a91384083c13fb4d743f500fef7a6629dfd5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 18:06:46 +02:00
Tor Arne Vestbø
f418a96f9b Disable warning about self-move and self-assign-overload
Change-Id: I1d20d3f424eced5cc5787934663b9d243f75d46e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 18:06:34 +02:00
Tor Arne Vestbø
d1fd2ff11f Fix warning when comparing qsizetype to result of sizeof
warning: comparison of integers of different signs: 'qsizetype' (aka 'long long') and 'unsigned long'

Change-Id: I03acb1f7aed782169a0a42cd8afc84b85991cd1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 18:06:21 +02:00
Tor Arne Vestbø
d96193b0ec Fix warning when printing of qsizetype
warning: format specifies type 'int' but the argument has type 'qsizetype' (aka 'long long')

Change-Id: I6099b53efecea46d191d5dc019c986f99e49c1f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-26 17:39:31 +02:00