Commit Graph

44417 Commits

Author SHA1 Message Date
Fabian Kosmale
cf000d080c QMetaType: support manual unregistration
QtDeclarative registers types in plugins, and supports un- and reloading
those plugins. Those types would leave pointers to unmapped memory in
the type registry on macOs, which would later cause crashes.
We therefore add private API to manually remove the types from the
registry, which can then be used in declarative.
Lastly, as a precaution for re-registering the types, we reset
QMetaTypeInterface::typeId to 0, as the memory is most likely not reset
to 0 when reloading the plugin.

Change-Id: Ic3fc08759f3d4481dca44a91b33baf3ea9e7198e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-03 14:14:00 +01:00
Qt Forward Merge Bot
2f2d870fdd Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-03-03 14:13:53 +01:00
Qt Forward Merge Bot
63312fe2ec Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
2020-03-03 14:13:02 +01:00
Allan Sandfeld Jensen
bbe71efc23 Only declare comparison operators for QVector when comparable
This avoid SFINAE from incorrectly assuming QVectors of
non-comparable types has them.

Change-Id: Ie44eb7873384a0f41a6b8160c340b71ea25839dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 08:27:21 +01:00
Mårten Nordheim
fbebc93617 Deprecate public bearer classes
The WARNING_PUSH/POP in QNetworkProxy is needed because it triggers
a warning when compiled which means a warning gets printed under
compilation which means tst_bic fails.

[ChangeLog][Deprecation Notice][QtNetwork] QNetworkConfigurationManager,
QNetworkConfiguration and QNetworkSession are deprecated, to be removed
in Qt 6.

Change-Id: Ife87722045ea10adf667388a1bf94c4f9bc8d5f0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-02-29 00:39:27 +01:00
Volker Hilsheimer
a53a52a631 Name method parameters in declaration, even when it's obvious
As pointed out during header review. Makes Qt more IDE friendly.

Change-Id: Icb610dba39e39ffd6674c79d9c6e087294788489
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-02-28 20:37:01 +00:00
Volker Hilsheimer
2090b770da Make QProcess::splitCommand accept QStringView, as per header review
A static function that only parses the string to create the list, so
no need for a QString overload.

Change-Id: I1df297adb795095d6eec94ccfcad52498178a7b1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-28 21:36:51 +01:00
Jarek Kobus
5ebb03c476 Remove flagBits from QMatrix4x4
Change-Id: I14a22f3272b4793abd1e1b448351c94d3e07e946
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-28 18:08:45 +01:00
Jarek Kobus
543e87c65a Bump the datastream version for Qt 6
We don't support obsoleted QMatrix type anymore.

Change-Id: Id412510aa1ad08d6e89a73da3317152e6dfa8f57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 18:08:45 +01:00
Andy Shaw
7e5f38aec6 Android: Add support for getting information about content uris
This enables things like size(), exists() to work with Android content
uris with the provided uri given from a filedialog. It is expected that
it is always a full path due to the nature of content uris, so relative
paths will not work.

Change-Id: I9c9ea42833677eb9d937b33e9dd42ee2a7d9c7c5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-02-28 16:37:34 +02:00
Allan Sandfeld Jensen
ca9de96233 Avoid using deprecated QTabletEvent::device() method
It was renamed to QTabletEvent::deviceType() in
882f340f62.

Change-Id: I070404bfc9a04144ae3565bfa3cc3a016040a07d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-28 14:37:12 +00:00
Edward Welbourne
895939c7f9 Deprecate QString::SplitBehavior in favor of Qt::SplitBehavior
This requires changing which of the two families of methods gets to
take a default argument for its behavior.

Task-number: QTBUG-81853
Change-Id: I6759bedd9af364d6e12bb39cd539b5dcba37027e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:12 +01:00
Edward Welbourne
b47cf3fe2d De-inline Qt::SplitBehavior splitters of QString and QStringRef
Convert the QString::SplitBehavior variants to call them, rather than
the other way round and convert the internal infrastructure to use
Qt::SplitBehavior, ready to deprecate the QString::SplitBehavior
versions without generating intenal warnings.

Task-number: QTBUG-81853
Change-Id: Ia6b78881c3d0e30a7bbd4dfd00cc15a407f448a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
305ddbeb5b Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
26b1cf2bba QMake: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I3f1b836cfb47bba0fdc27f2c3aa7b0576d123dca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
00f0863cbe Core: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
8c613ed74b SQL: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: Ia4c698df60648c85c8e6132641e5ea7bc553129a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
c158f881b3 Docs: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Applied suitable wrapping round various char and string literals,
since docs are meant to show best practice.

Change-Id: Ie061905fad26f9b4dda3eedba4612704f0a19126
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Jan Arve Sæther
8de66e1f24 Remove a "### Qt 6" that I forgot to remove
amends commit 5e83a2eed2

Change-Id: I792d5d71d8c5a8b034d334de31dcd9bacfc53fa9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-28 15:37:11 +01:00
Johan Klokkhammer Helsing
3673ee9823 Fix build errors for GraphicsViewBenchmark
QGL* has been removed amongst other things

Task-number: QTBUG-74408
Task-number: QTBUG-74409
Change-Id: Ia19774f2bb6d0b86b3fbde224cbc8652b4ae0b22
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-28 12:03:48 +01:00
Edward Welbourne
b6fad7588a Correct pro2cmake's Requirements message
It only told me about two packages to install, so I got an error after
I'd installed them and ran it, because I hadn't installed the
rest. Save the next person an extra round-trip.

Change-Id: I8b544fc2637b86656ec2adddce8e95e6e9e1daf5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-28 10:47:36 +01:00
Mitch Curtis
981c1fe15f QDebug::toString(): use nospace()
The intended use cases for toString() are the situations where you
can't use operator<<, such as QVERIFY2, Q_ASSERT_X, etc., which means
that it will often be used as an argument to e.g. QString::arg(), where
the user has control over the structure of the message. For that
reason, adding an extra space to the end is not necessary and just gets
in the way.

This amends 658b9697f9.

Change-Id: I0695e6809026a0f92ed783899da80de4fa2a1684
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 10:16:15 +01:00
Lars Knoll
7ef6ddaf7a Remove useless autotest
qtokenautomaton is something from xmlpatterns. The fact that this
didn't fail with xml patterns not part of qtbase anymore shows that
the test doesn't do anything :)

Change-Id: Ibb1705fe57dac148f0283fba1193126d4d924868
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 10:07:05 +01:00
Lars Knoll
c946b07d9c STL compatibility: erase() should take a const_iterator as argument
erase() takes a const_iterator as argument in std::vector. We should do
the same to facility better interoperatbility.

Fixes: QTBUG-81915
Change-Id: I60ffb0eb45955be8e3e6aeaa56998f7c668fed09
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 10:07:01 +01:00
Johan Klokkhammer Helsing
9f041c4f3b glgen: Fix endl warnings
Change-Id: Ibb4fd83778a5d6c00cabae55c14ba3e771345aef
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-28 09:59:53 +01:00
Johan Klokkhammer Helsing
eca884a483 Remove various traces of QGL
Removed friend declarations, some check etc.

Task-number: QTBUG-74408
Change-Id: I1c5b46a564beee2c1d894678b908803f91df68aa
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-28 09:59:39 +01:00
Lars Knoll
60f12c58a0 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-02-28 09:53:26 +01:00
Lars Knoll
a450cce6b6 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I469b0501cc65fc5ce4d797a69ae89405cc69c7f8
2020-02-28 09:48:30 +01:00
Jarek Kobus
1ba46c9b63 Get rid of QMatrix
Task-number: QTBUG-81628
Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 08:57:57 +01:00
Kai Koehne
e1b6c67bcd Doc: Fix punctuation for QMetaType::QMetaType()
Change-Id: I99d78ae475844f3d145952fd789c5753979745f7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-28 08:41:36 +01:00
Kai Koehne
4e51dc440f Doc: Fix documentation for deprecated methods in QJsonDocument
\deprecated has to stand on its own - qdoc will ignore anything on the
right side of it.

Change-Id: Ib698aa66826d6430bbafd926a9c64febd5463c5c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-02-28 08:41:36 +01:00
Kai Koehne
e939d34a9f Doc: Fix wording of operator=!(QMetaType, QMetaType()
Change-Id: I02ca10f968acb42a6e0d793cad78d7d0baa7f472
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-28 08:41:36 +01:00
Kai Koehne
da059d0382 Doc: Fix punctation in QPdfWriter::addFileAttachment
Change-Id: Ic00ffd88ecbaa88409bf968f6794fad6f53a2f0e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-28 08:41:36 +01:00
Kai Koehne
6d5d467bcf Doc: Replace 'In alternative' with 'Alternatively'
Amends b19220d17f

Change-Id: Ic6869ce77440b43b30248f1130dabe8cc1b231e9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-02-28 08:41:36 +01:00
Johan Klokkhammer Helsing
d2068b24e4 Manual tests: Port diaglib from QGL to QOpenGL
Task-number: QTBUG-74408
Change-Id: I25dedd69c6927e5d627f8104c404e23ce68487d9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-28 08:16:32 +01:00
Samuli Piippo
963017f588 Prepend prefix path after loading toolchain file
The original toolchain file may set CMAKE_FIND_ROOT_PATH instead of
appending it, which overrides the Qt's path.

Change-Id: I69a4bf4be6a999854bb8a84cf5032c6a9b739b2e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-28 08:31:34 +02:00
Alexander Akulich
4c86e667d2 Revert "QNetworkReply: deprecate the 'error' getter"
This reverts commit ccb2cb84f5 and
commit 0f568d0a67.

The patches fix ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commits to keep the getter as is and change the signal name instead.

Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 07:21:14 +03:00
Kai Uwe Broulik
c2a13ae501 QConcatenateTablesProxyModel: Add getter for sourceModels
Currently, there's no generic way to get the source models as there's only
calls to add or remove them.

Change-Id: I23cdef7c93328b58a80ec4659b44073f8ff05088
Reviewed-by: David Faure <david.faure@kdab.com>
2020-02-27 21:10:21 +01:00
Thiago Macieira
ede8545245 QMimeXMLProvider: add missing semi-colon in the #else case
Fixes: QTBUG-82547
Change-Id: Ia8b65350cd5d49debca9fffd15f74e22c0536805
Reviewed-by: David Faure <david.faure@kdab.com>
2020-02-27 11:06:02 -08:00
Assam Boudjelthia
ecae4732a7 Android: QFileDialog::selectedFiles() check isLocalFile()
call toLocalFile() only if the returned QUrl::isLocalFile() is true,
otherwise return toString(). Same thing as done for QFileDialog static
functions as in 1576f81baa.

Change-Id: I3f8cab385e32d0943587b3382a636ea3a168d518
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-27 18:37:43 +00:00
Robert Loehning
cb1145fb26 Fuzzing: Add fuzz target for QCborValue::fromCbor
Change-Id: I59fbab99849a23c553520db33d6c7182dc7b114d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-27 19:36:30 +01:00
Lars Knoll
bb802b4318 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-27 19:35:43 +01:00
Volker Hilsheimer
924b97d6ab Fix QDateTimeEdit's handling of invalid time in dst gap
During a spring forward, a time-zone omits an hour. A QDateTime with
such an hour is invalid, but QDateTimeEdit's handling of this invalid
time was not done correctly.

With this fix, up/down changes of any field that would result in an
invalid date-time corrects the time to be valid, while leaving as
much as possible of the user-entered data unchanged. To do that, we
rely on QDateTime::toMSecsSinceEpoch to return a value even for such
an invalid time, which then can be used to construct a valid
QDateTime.

Edits that would result in an invalid hour are reverted to the
previous when pressing return, if correctionMode is
CorrectToPreviousValue. This change also implements support for
CorrectToNearestValue, which uses the same mechanism as when stepping
over an invalid time.

Include a test that verifies that the various interactions result
in a reasonable value. Since QDateTimeEdit does not respect the
timezone or timespec of the QDateTime it is initialized with, we
have to find the first hour of daylight saving time for a year
that we know works for most time zones. Failing that, we have to
skip the tests. Verified in a wide range of time zones.

Change-Id: I05b906ae3b5f6681891d23704f00f9c10cd479ae
Fixes: QTBUG-79803
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-27 19:35:28 +01:00
Volker Hilsheimer
31b06a0437 QWizard: deprecate visitedPages and add visitedIds instead
As per the ### Qt 6 comment. A method visitedPages should, following
the convention of the other QWizard APIs, return a list of QWizardPage
pointers. Since the method returns a list of IDs, visitedIds is the
correct name.

[ChangeLog][QtWidgets][QWizard] visitedPages has been deprecated, use
visitedIds instead.

Change-Id: Ifdb94adf093be14cb48c84cb40818c55ff5189a0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-02-27 19:35:19 +01:00
Volker Hilsheimer
cb390719c6 Remove ### Qt 6 comment that we won't address
QStatusBar is 22 years old, and those protected APIs have been around
ever since. There is no good reason to make them private now.

Change-Id: I62624800d8e287e21535967aa6a861b98cae97d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-02-27 19:35:08 +01:00
Johan Klokkhammer Helsing
f6f6eab89f Remove opengl benchmark
It used QGLPixelBuffer. Not sure how/if it could've been ported to QOpenGL.

Task-number: QTBUG-74408
Change-Id: I1271f501ccad4ae391ee0f6fc5a1ddfaf46ef0af
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-27 14:31:49 +01:00
Lars Knoll
5c6c0289f0 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4212d070d5752275085e754b96f0392113604dba
2020-02-27 14:22:01 +01:00
Alexander Akulich
cb26a4da69 QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-27 13:56:45 +01:00
Edward Welbourne
0ad4f86729 Purge QRegExp use in QDateTime's rfcDateImpl()
Replace with a parser which actually does the job right, fixing
various infelicities in the parsing in the process.
Make the parser strict about formatting.

Adjusted tests to match. Fixed some QTime invalidity tests to each
test only one invalidity at a time (the invalid year and day tests
also used an invalid month).

[ChangeLog][QtCore][QDateTime] The parser for the Qt::RFC2822Date
format is now stricter, requiring the text to exactly match the form
of one of the relevant formats. A valid date or time will still be
parsed, even if the other part of the content is invalid, as long as
it (and any offset, if present) has the right form. In particular, the
parser now rejects texts with trailing cruft (other than space).

Fixes: QTBUG-80038
Change-Id: Id25675afd75f82f6351f20e79f0154f3ceda35ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-27 10:48:25 +01:00
Edward Welbourne
af837734b2 Pass QDate and QTime as value classes
It's what they are, so const refs are needless burden.
In the process, consolidate two of the affected methods (one of which
just adds another argument to the other's signature) into one.

Change-Id: I80de35ffe078a652d1999889dede0b10302abaa9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-27 10:48:25 +01:00