Commit Graph

12034 Commits

Author SHA1 Message Date
Mårten Nordheim
0592369df4 tst_qnetworkreply: stabilize and unblacklist getFromHttpIntoBuffer2
The test in general is fine, but it was making an assumption that the
first 5 readyRead emissions would never result in the whole message
being received. In certain scenarios with slowdown however it was still
possible that we would receive the whole message after just a few
readyReady emissions. While I didn't check it's most likely due to a
mechanic in the QNetworkReply machinery where we suppress some
emissions if we know there's more data just about to be available.

Task-number: QTBUG-88943
Change-Id: I0cf06edb34d4e86cc8a42c0f1cd7e8c35765f6ee
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-04 00:17:46 +01:00
Mårten Nordheim
27f52942b4 tst_QTcpSocket: stabilize connectToHostError
It's not _wrong_ to time out when connecting to something unreachable
(it's just a different way of handling it) so we shouldn't fail when
this happens either.

In local testing (windows) it times out after 8 seconds, so bump
the timer to 10 seconds. On systems where it's faster there'll be
no difference as long as things don't go wrong.

Pick-to: 6.0
Fixes: QTBUG-89089
Change-Id: I8437cf8e4fbecedea2391ed87fdce1213085b964
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-04 00:17:46 +01:00
Karsten Heimrich
a0e04e7d2b Add test for QTranslator::load() translation file lookup algorithm
Pick-to: 5.15 6.0
Change-Id: I70f4b3d7dbc46d21065eab21a5af8a38d4a60589
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-03 07:49:58 +01:00
Giuseppe D'Angelo
7a32a2d809 tst_containerapisymmetry: fix typo
Change-Id: I9fd5c982a72cd4483108293667b2ae60f7b82ce7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:51:29 +01:00
David Skoland
3ca921293a Add test for qRound
Add test for qRound that covers some edge cases for rounding. Note that
as of right now, this test fails and the docs have been updated to warn
that it should not be depended on for strict correctness.

Change-Id: I1a61bca47abd77855fe7c13ded44e913cc7e8722
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-02 21:24:19 +01:00
Timur Pocheptsov
89734289d5 tst_qnetworkreply: cleanup BLACKLIST
Which contains a lot of 'macos'/'osx' black-listed auto-tests. They
mostly fail with SecureTransport (on BigSur) because SecTrustEvaluate()
does not like our old certificate. Instead, since SecureTransport
is deprecated anyway and we are not planning to develop it in future,
skip the related auto-test depending on QT_CONFIG(securetransport).

Task-number: QTBUG-88943
Change-Id: I5f6cb7b2d0ea15c445603c1ff3e1700f123c28d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-12-02 17:39:06 +01:00
Mårten Nordheim
dcb10dfe81 Unblacklist tst_qnetworkreply getFromHttp
It was blacklisted due to the issue there. The issue is resolved, but
the blacklist stayed.

Task-number: QTBUG-88943
Change-Id: I7d9a660a17c1463dd8b654752ed5787fe5f5af24
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-02 17:39:04 +01:00
Eskil Abrahamsen Blomfeldt
34fa01be82 Fix tst_QFontDatabase::aliases failure with ambiguous font
If the first font in the families list happens to have been
disambiguated because of duplicates, two things went wrong:

1. hasFamily() would return false for the font family, because
it does not disambiguate when checking for the family name and
only checks if the families list contains the exact string.

2. Adding aliases to the full disambiguated string is not supported,
only the family name.

The first issue has been reported separately as QTBUG-89068.

The test failure is fixed by just avoiding the fonts that
are ambiguous in the test, as it really doesn't matter which
font we pick.

Fixes: QTBUG-89008
Pick-to: 5.15 6.0
Change-Id: I829778c2e7bb6090475c34dcf9cdce58862729d6
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-12-02 16:22:27 +00:00
Giuseppe D'Angelo
e12e2b43b7 Associative containers: add erase_if
Use a trick similar to the one we use for their ranged
constructors: support predicates that either take a
container's iterator, or that take a std::pair (for STL
compatibility).

[ChangeLog][QtCore][QMap] Added removeIf() and erase_if().

[ChangeLog][QtCore][QMultiMap] Added removeIf() and erase_if().

[ChangeLog][QtCore][QHash] Added removeIf() and erase_if().

[ChangeLog][QtCore][QMultiHash] Added removeIf() and erase_if().

Change-Id: Ie40aadf6217d7a4126a626c390d530812ebcf020
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-02 10:35:14 +01:00
Mårten Nordheim
65bcac95a7 Http2: Remove errored-out requests from queue
The requests will remove themselves once they get deleted
but since the deletion is done through a _queued_ invokeMethod
to 'deleteLater' we will call
QHttpNetworkConnection::_q_startNextRequest first which may
end up starting a reconnect of the TCP socket which we had the error on.

In this specific instance it manifested as a race condition where we
either don't get a proxyAuthorizationRequired signal at all (it was
emitted while we didn't have any valid replies), or we get the signal
emitted too late and it gets emitted on whatever the next reply was.

Task-number: QTBUG-88417
Pick-to: 5.15 6.0
Change-Id: If3f8ececc5550f1868c90124559cb8e3029646d8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-02 10:17:12 +01:00
Mårten Nordheim
734c8aa9d9 QSet: add insert(T&&)
We already have all we need in QHash to support this, so the addition
is simple enough.

Add test checking how many copies and/or moves are needed for a single
insert.

As a drive-by: remove some unneeded static_cast

Change-Id: Iaf768657644afa45f78f5c81ffcf89ba9607be96
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-02 10:17:11 +01:00
Giuseppe D'Angelo
bec8f9ca92 Add tests for the new erase/erase_if for sequential containers
Change-Id: I3bac5f6f04f3028fbc21f1b4b15b00252a7accb1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-01 23:03:32 +01:00
Giuseppe D'Angelo
dc091e7443 tst_containerapisymmetry: use an algorithm
In preparation for the next changes.

Change-Id: Ibe0635dfa040842073749aa3e2ae140f27dc983a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-01 23:03:31 +01:00
Shawn Rutledge
2e0f7117b6 Fix deprecations in manual tests
QEventPoint instead of TouchPoint:  we have source compatibility for that,
but we can use the new type to avoid the deprecation warnings.
Some position accessors have been renamed too.

Change-Id: I5bfe5bc853931127a883d2bd61fab122495fd427
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-12-01 20:20:11 +01:00
Lars Knoll
60ea10e70b Add a way to check whether a metatype has datastream operators
Add QMetaType::hasRegisteredDataStreamOperators() to complement
the method to check whether a data stream operator exists.

Fixes: QTBUG-82916
Change-Id: Ib2f841131b7c401d5a3ae76d49104e41697c4eac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-12-01 16:01:08 +01:00
Giuseppe D'Angelo
b5b2640a65 QHeaderView: fix spurious sorting
QHeaderView sorting may be triggered when the user performs
some mouse interactions that should really not result in sorting.

Generally speaking, this happens when the user:

* presses on a non-movable section (A)
* moves on another section (B)
* releases on that section

resulting in B becoming sorted / flipping sorting.

(Non-movable is required, otherwise dragging would cause section moving,
not sorting.)

To make the matter worse, QHeaderView doesn't check that the release
happens within its geometry. This makes sense when moving sections: one
is able to drag a section horizontally/vertically even if the mouse
leaves the QHeaderView.

But when not moving sections, this means that one can

* press on section (A),
* move the mouse anywhere vertically (for a horizontal bar, mut.mut
  for a vertical) above or below another section (B), that is,
  outside QHeaderView's geometry
* release the mouse

and cause B to be sorted.

Fix it by

1) remembering which one was the section that the user originally
clicked on; that's the only one that can possibly become sorted
(if we're not moving and other conditions hold). No other variable
seemed to remember this.

2) on release, check that it happens within that section's geometry.
If so, sort.

Pick-to: 6.0 5.15
Change-Id: Icfb67662221efbde019711f933781ee1e7d9ac43
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-12-01 15:57:10 +01:00
Fabian Kosmale
b21dba98e3 QProperty: Avoid spurious dependencies by suspending binding state
Avoid spurious bindings by resetting the binding state before calling
the setter of eager properties.

Fixes: QTBUG-88999
Pick-to: 6.0
Change-Id: I1e3b5662307d906598335a21d306be9c606529d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-01 15:06:35 +01:00
Fabian Kosmale
cea8b5832c QProperty: add test case for spurious dependency issue
Task-number: QTBUG-88999
Pick-to: 6.0
Change-Id: Ifcbf23fedfb795771550762dfed8fc38bce65794
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-01 15:06:31 +01:00
Mårten Nordheim
6035fd8f2c tst_qtcpserver: Test pauseAccepting/resumeAccepting
Currently untested

The socks case is odd: after accepting the first connection it shows as
unconnected. Details as for why is unknown, out of scope of adding this
test.

Pick-to: 6.0
Change-Id: I0e7658f23b89f3af8db379b001ee33a844f3bec4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-01 14:42:56 +01:00
Mårten Nordheim
f7d7060b60 QNetworkDatagram: Test copy ctor and clear()
As they were not currently tested

Change-Id: I91bc8dead2c098376001a8502d29bfc746d33f73
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-01 14:42:54 +01:00
Mårten Nordheim
1911a4d40a QDuplicateTracker: add tests
It didn't initially have tests. To avoid relying on realizing
breakage implicitly through other classes we'll just add tests instead.

Task-number: QTBUG-88183
Pick-to: 6.0
Change-Id: I7449dc1f9a118d4b7a8158a2c34563dbd9c43c66
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-12-01 14:42:52 +01:00
Andreas Buhr
caa632803d Disable some OpenGL and QRhi tests for offscreen backend
This patch disables four failing unit tests when executed with the
offscreen backend.

Change-Id: Ie67341b886984e6de19cd8dd8a8a237a620a1b7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-12-01 14:14:45 +01:00
Volker Hilsheimer
2885a99c32 Fix compiler warnings from mixing signed/unsigned ints
Change-Id: I146203dd8b6dddabc0a7cf4b3db8a3fd379fc0c6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-12-01 09:12:10 +01:00
Timur Pocheptsov
fe009bd514 tst_QSslError: improve the code coverage, as pointed at by LCOV
And also, reduce the utter sloppiness, weirdness of the test and
make it more a test and not a joke. Since the test itself depends
on !QT_NO_SSL, why bother building and running its main, to create
a useless tst_QSslError and do nothing then? Exclude test from
no-ssl build.

Pick-to: 5.15
Pick-to: 6.0
Change-Id: I67879b0de036cbc8c2f75a18f4cf94e6c43c5af0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-12-01 09:12:10 +01:00
Lars Knoll
de4a73ebd6 Inline access to the QBindingStorage
And inline the fast checks inside the methods in QBindingStorage.
This allows QObjectBindableProperty and friends to inline all the
fast checks and almost completely eliminates the overhead for property
accesses when no bindings are being used.

Read and write times of QObject based properties when no bindings
are being used:
                                              Read       Write
Old style property:                           3.8ns       7.3ns
QObjectBindableProperty (no notification):    4.5ns       4.3ns
QObjectBindableProperty (with signal):        4.5ns       7.6ns
QObjectBindableProperty (inline accessors):   3.2ns       3.4ns

Numbers without this patch:

Old style property:                           3.8ns       7.9ns
QObjectBindableProperty (no notification):    7.2ns       7.7ns
QObjectBindableProperty (with signal):        7.2ns      16.0ns
QObjectBindableProperty (inline accessors):   6.3ns       6.7ns

Change-Id: Ifd1fa3a489c3be8b1468c0b88af547aac397f412
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 98c82fb445acf45cc4c4bc86a5adda43358127bf)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-30 23:02:27 +00:00
Timur Pocheptsov
1158ff67b4 QSslSocket::verify: do not alter the default configuration
QSslCertificate::verify() has an undocumented and not very desirable property -
on some platorms it updates the default configuration, which can be surprising.
For example, we deprecated QSslSocket::setDefaultCaCertificates() and recommend
using QSslConfiguration::defaultConfiguration(), QSslConfiguration::setDefaultConfiguration(),
and QSslConfiguration::setCaCertificates(). If an application does this to select
CA roots it trusts explicitly, and then for some reason is calling verify, the
application can have its QSslSockets successfully connecting to a host, whose
root was not trusted by the application. Also, on Windows, defaultCaCertificates()
include system roots already, no need to have them twice.

[ChangeLog][QtCore][QtNetwork] QSslSocket::verify - do not change the default configuration

Pick-to: 5.15
Pick-to: 6.0
Pick-to: 6.0.0
Fixes: QTBUG-88639
Change-Id: I1cd40b259d0a6dcd15c78d1e7c027ff10859595c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-30 23:11:05 +01:00
Timur Pocheptsov
6a1d9f6fc1 QDtls(cookie verifier): make sure a server can re-use 'Client Hello'
And extend an auto-test for this. When a cookie verification mechanism is
enabled, and verifier, indeed, verifies that some datagram is a 'Client Hello'
message with a proper cookie attached, we start a real DTLS handshake creating a
QDtls object and calling 'doHandshake'. In case cookie verification
was enabled, we need parameters from the verifier (it's a crypto-strong
'number' and hash algorithm) to 'lock and load' the TLS state machine in
a freshly created TLS session object. This code path previously was only
tested manually and was found by LCOV as untested.

Pick-to: 5.15
Pick-to: 6.0
Change-Id: Ieacb8c989997999ea10e15bda6ae106a0338b698
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-30 23:11:05 +01:00
Timur Pocheptsov
bf7cec737f tst_QSslKey: remove blacklist
And do not run the test with QSslSocket::supportsSsl() returns false -
this may mean unresolved symbols and thus missing functionality,
like i2d_X509 etc. This also makes cases more like other, that already
had those checks.

Fixes: QTBUG-87386
Change-Id: If4e9a650ca325b6f70956f532891a4c1d50465c0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-30 23:11:04 +01:00
Kirill Burtsev
6c442ddbf5 Add widget-based test for TouchCancel event
Follow up for 45a65cbeb2

Pick-to: 6.0
Change-Id: Idb4f4eaaa3ee583462430c530f88a4cc32378d6c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-30 23:11:04 +01:00
Timur Pocheptsov
efd20cafe5 tst_QSslCertificate - improve code coverage
Some code-paths were never executed by auto-test, thus giving us LCOV's
diagnostic. Extend existing tests and add new ones.

Pick-to: 5.15
Change-Id: I648747547f0525a482216b1e1972fcc698c73f65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-30 17:16:22 +01:00
Fabian Kosmale
5082b84b38 QMetaObjectPrivate: Add firstMethod
QMetaObject::indexfOfMethod returns the method corresponding to a
specific signature. In QML, we however only want any of the methods with
a given name (and do overload resolution at a later point).
For this usecase this patch introduces the internal
QMetaObject::firstMethod function.

Change-Id: Ie3820354edffb273c4cbe1399201a955ebe79344
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-30 17:16:22 +01:00
Giuseppe D'Angelo
405244fe30 Fix QVariant/QMetaType::compare APIs
std::optional<int> is the wrong datatype to use for compare.

First and foremost, it can't be used in the idiomatic form of

  auto r = a.compare(b);
  if (r < 0) ~~~ // a is less than b
  if (r > 0) ~~~ // a is greater than b

which we *already* feature in Qt (QString, QByteArray).

Also, std::optional<int> (explicitly) converts to bool, which is
a trap, because the result of the comparison can be accidentally
tested as a bool:

  if (a.compare(b)) ~~~ // oops! does NOT mean a<b

Not to mention extending this to algorithms:

  auto lessThan = [](QVariant a, QVariant b) { return a.compare(b); }; // oops!
  std::ranges::sort(vectorOfVariants, lessThan);

which thankfully doesn't compile as is -- std::optional has
an *explicit* operator bool, and the Compare concept requires an
implicit conversion. However, the error the user is going to face
will be "cannot convert to bool because the operator is explicit",
which is deceiving because the fix is NOT supposed to be:

  auto lessThan = [](QVariant a, QVariant b) { return (bool)a.compare(b); }; // big oops!

Instead: backport to Qt the required subset of C++20's <compare>
API, and use that. This commits just adds the necessary parts
for compare() (i.e. partial ordering), the rest of <compare>
(classes, functions, conversions) can be added to 6.1.

Change-Id: I2b5522da47854da39f79993e1207fad033786f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3e59c97c3453926fc66479d9ceca03901df55f90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 17:16:22 +01:00
Giuseppe D'Angelo
81e893fb2d QHash: support std::hash as hashing function
In addition (and as a fallback) from requiring qHash, add support
for std::hash specializations. This catches two birds with one stone:

1) users of Qt can simply specialize std::hash for their datatypes,
and use them in both QHash and stdlib unordered associative containers;

2) we get QHash support for any (stdlib) datatype that is hashable
without having to overload qHash for them.

[ChangeLog][QtCore][QHash] QHash, QMultiHash and QSet now support
for key types anything that can be hashed via std::hash, instead of
always requiring a qHash() overload.

Change-Id: Ib5ecba86e4b376d318389500bd24883ac6534c5f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-30 17:16:22 +01:00
Giuseppe D'Angelo
d982fdfca4 QHeaderView: allow un-sorting of models
If one clicks on a QHeaderView's section, the header view will
sort the view by the respective column/row. By clicking multiple
times, one is able to toggle the sorting between ascending
and descending. Something that is NOT possible to do however is to
un-sort the view -- that is, to restore the model's original
sorting. This must be done via code, by asking the header or the
view to sort by section -1.

This commit adds new property to QHeaderView to make it possible
to unsort models. Basically, the sort indicator becomes a tri-state:
sort ascending, sort descending, unsort (sort by column -1).

[ChangeLog][QtWidgets][QHeaderView] Added the sortIndicatorClearable
property. Setting this property allows the user to clear the sort
indicator on a section, resetting the model to its default ordering.

Change-Id: Ibf4e280b2086b75ccd64d619ea4d70816dc3529f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2020-11-30 18:16:21 +02:00
Ivan Solovev
3cacf1d1bd QCollator: extend tests
- Add tests for QCollatorSortKey
- Add test for QCollator copy assignment and copy construct
Currently QCollatorSortKey tests are working properly only
with QT_CONFIG(icu)

Task-number: QTBUG-88546
Change-Id: Ic35dfd33038cc736245904b78fe4383a5a11b580
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-30 17:16:21 +01:00
Andreas Buhr
0440614af0 Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this
patch should have no impact on users.

Pick-to: 6.0
Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-30 17:16:21 +01:00
Andreas Buhr
5e84023344 Fix warnings about unused variables in benchmarks
This patch removes two unused variables and marks one unused, fixing
three warnings.

Change-Id: I71f59839452590b82ffb5459a968f06bd434fb9a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-11-30 17:16:21 +01:00
Alexander Volkov
68de00e0d4 QStandardPaths: Don't change permissions of XDG_RUNTIME_DIR
Conform to the XDG Base Directory Specification:
"If, when attempting to write a file, the destination directory
is non-existent an attempt should be made to create it with
permission 0700. If the destination directory exists already
the permissions should not be changed."

At the same time the spec states about XDG_RUNTIME_DIR that
"its Unix access mode MUST be 0700", so don't consider the
directory with wrong permissions correct and use a fallback.

Task-number: QTBUG-68338
Pick-to: 5.15 5.12
Change-Id: I03c6b35b3f7d5ceb8e6326695bfc8207da92ea67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2020-11-30 19:16:21 +03:00
Fabian Kosmale
d27d2b5d72 QMetaProperty::typeName: use name from metatype
Except for types marked as unresolved, we're doing it anyway - the only
difference is that now we skip looking up the metatype by typeid.

[ChangeLog][QMetaProperty][Important Behavior Change]
QMetaProperty::typeName returns now always the same name as name() of the
corresponding metatype. This can cause a change for enum properties
which were not fully-qualified.

Change-Id: I1f57743948b7262ac06095d3bbc838d620f6e481
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-30 17:16:21 +01:00
Fabian Kosmale
26e1a0997e QMetaObjectBuilder: remove relocatable data support
Change-Id: I6f1dc9e81723e9a8af8988a8cb45c63c05214296
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-30 17:16:21 +01:00
Fabian Kosmale
2cea05fce9 tst_qmetaobjectbuilder: Clean-up deallocation of dynamic metaobjects
If a testcase failed before we reached free, the QMetaObject would have
leaked.
Moreover, defer freeing until all tests have run: dynamic QMetaObjects
might create dynamic metatypes. If those were shared, we would run into
issues.

Change-Id: I2edfcb2605e58eaba454bfe0446a6b187a5210df
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-30 17:16:21 +01:00
Fabian Kosmale
71200ae11d tst_qmetaobjectbuilder: more descriptive error messages
Change-Id: I7e430f5033d18cf3dc804294bbaac16b0d3f348a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-30 17:16:20 +01:00
Fabian Kosmale
465701bb98 QMetaPropertyBuilder: carry metatype
Properties of non-dynamic classes always have the metatype stored, so we
can make use of it. Moreover, when the builder is converted into a
metaobject, we need to resolve the metatype anyway.
As a driveby, add a dedicated metatype test to tst_qmetaobjectbuilder.

Change-Id: I7eea0cd8fc2da5d92c7fc803f05cd81e3a9d4cf4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-30 17:16:20 +01:00
Wang ChunLin
66acca3316 Fix invalid QSortFilterProxyModel::dataChanged parameters
QSortFilterModel shouldn't forward dataChanged() when the source model changes data in columns that the filter model refuses

Fixes: QTBUG-86850
Pick-to: 5.15
Change-Id: I26565d119d2aa36ea07b3de0c15f1b137bc002f8
Reviewed-by: David Faure <david.faure@kdab.com>
2020-11-30 12:39:21 +08:00
Volker Hilsheimer
6b85f4f9fe Fix compiler warning - remove dead code
The function is unused.

Change-Id: Ib2154398981c0db20a2096c83b371d12920e34ea
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: David Skoland <david.skoland@qt.io>
2020-11-27 13:26:54 +01:00
Edward Welbourne
bbe74df26f Use QCOMPARE(,) in preference to QVERIFY(qFuzzyCompare(,))
The former also does fuzzy comparison, but it reports what the values
were, if the test ever fails.

Change-Id: I36ecda1f69bf3f430c904b37cd8c3a23201ab7e2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-27 13:26:52 +01:00
Edward Welbourne
4785e39156 QCalendar: increase coverage by tests
Added tests for aliases and various calendar properties, ensured
dateToJulianDay()'s invalid date branch is exercised. Corrected
assertion when constructing from system and asserted calendarSystem()
is as expected.

Pick-to: 5.15
Task-number: QTBUG-88183
Change-Id: I510afcb5d9d115f68148d1f679f3224d712f92f4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-27 13:26:52 +01:00
Volker Hilsheimer
27f78b9da5 Fix compiler warning from comparing signed to unsigned
std::vector::size returns size_t, which is unsigned.
Change-Id: I81ba3d58a1bd3a3c3d90c911263a5c0df0441b16
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-11-27 07:28:25 +00:00
Volker Hilsheimer
c2dbc26893 Fix compiler warnings from deprecated method
QTextCharFormat::fontFamily is deprecated in favor of fontFamilies,
which returns a QStringList wrapped in a QVariant, whereas the setter
expects a QStringList.

Change-Id: I3333eaae4fc5ec3e3bdbec58047d6b3554b4a171
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-11-27 07:28:24 +00:00
Volker Hilsheimer
63c5d13885 Fix compiler warning from deprecated function
Change-Id: I34d6788fd5b9ab004b0e337933bea90c8f63717a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-11-27 08:28:24 +01:00