Commit Graph

42664 Commits

Author SHA1 Message Date
Lars Knoll
c3fc9a24d8 Avoid UB in QList::removeAt()
Always keep the out of bounds check for backwards compatibility,
but warn about it, so that we can remove it in Qt 6.

Amends commit ebf695bc77

Change-Id: I3f1e7e8f9f20feb0b0f06ff9083c26682f1c7d3b
Reviewed-by: Richard Öhlinger <richard.oehlinger@adbsafegate.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 11:39:56 +01:00
Qt Forward Merge Bot
dd704d4498 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-03 11:39:56 +01:00
Shawn Rutledge
761f46f8b5 Remove overrides of QImageIOHandler::name()
We will remove the virtual base class function in Qt 6.
For now, name() returns format().

Change-Id: I1597e823b859e4db148b3e5ac0f1c15350a582eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-03-03 11:39:56 +01:00
Assam Boudjelthia
873eba3f8b Examples: use QDialog::showMaximaized() for Android
Examples that use QDialog as main window should be maximized on Android
to avoid a black view on most of the screen.

Task-number: QTBUG-80717
Change-Id: I933c1a01d95d53da009c190c37fa32f27be5af5e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 12:39:56 +02:00
Edward Welbourne
275401f580 Warn about Q(Date|Time)+ switching to C locale in Qt 6
Change-Id: I3a3afc3fb4ddca405a75097feb15aee0e72b3b19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 07:38:06 +01:00
Edward Welbourne
84382bde5c Rename the localexml module to qlocalexml
It implements interaction with the QLocaleXML file format type, so
rename it to match.

Task-number: QTBUG-81344
Change-Id: I46302d4ac1038cdfc5929e73b554b6d793814c56
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-03 07:38:06 +01:00
Edward Welbourne
54413653d5 Rename the endonym members of the Locale type
All other members had camelCase names, but the endonyms had
prefix_endonym names, requiring munging where they were emitted to
XML. So just do that munging upstream in the attribute name of the
Locale objects. Makes no change to the data output by the scripts, not
even to the intermediate QLocaleXML file.

Task-number: QTBUG-81344
Change-Id: I01c15a822216281dc669b3e7ebda096d18b04f9b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-03-03 07:38:06 +01:00
Qt Forward Merge Bot
60ec012d8d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I851c0328c3c38ea67b5ad115b205ac6a1262706e
2020-02-29 01:00:44 +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
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
Volker Hilsheimer
4a1de178c9 Try again to make QDeadlineTimer test robust against context switches
Instead of comparing to absolute values, compare the result from
QDeadlineTimer with the reference clock types from std::chrono. Pass
the test as long as we are within 10% of that reference.

In addition, handle the case where QTest::qSleep sleeps for more than
10% longer or shorter than what is requested, and if so, abort the
test.

Change-Id: If8b77aea55a8c5c53e96427b2fff2f78281d0f82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:15:42 +01:00
Friedemann Kleint
08d5059320 Fix geometry handling for native child windows
Don't move the native child window position for native child windows.

Initial-patch-by: Błażej Szczygieł <spaz16@wp.pl>
Task-number: QTBUG-82312
Fixes: QTBUG-79166
Change-Id: I117ef08da13c8e90ff60cf034126c9efdc17b836
Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-02-28 13:43:01 +01:00
Shawn Rutledge
7447e2b337 QTextMarkdownImporter: fix use after free; add fuzz-generated tests
It was possible to end up with a dangling pointer in m_listStack.
This is now avoided by using QPointer and doing nullptr checks before
accessing any QTextList pointer stored there.

We have 2 specimens of garbage that caused crashes before; now they don't.
But only fuzz20450 triggered the dangling pointer in the list stack.
The crash caused by fuzz20580 was fixed by updating md4c from upstream:
4b0fc03077

Change-Id: I8e1eca23b281256a03aea0f55e9ae20f1bdd2a38
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-02-28 09:31:59 +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
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
Andy Shaw
eaf7f572bf Android: Don't recurse into directories inside the assets when iterating
When iterating, it should only return what is in the specified path and
not the contents of the sub-directories inside the given path in
addition.

Change-Id: Iad56f075c22fdf1c633582e37444e26520c24a73
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-02-27 22:56:26 +01:00
Andy Shaw
09c5dfb732 Windows: Enable closing the system tray menu when clicking outside of it
In order for the system to close a menu when clicking outside of it or
outside of the controlling window for the system tray then it needs to be
at the foreground right before the menu is tracked. This makes it act
like other system tray menus then.

Change-Id: I663670c506cfd1e2ba59cd3e75b12e1f8ba17c33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-27 22:56:26 +01: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
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
Cristián Maureira-Fredes
de1d51a3fd uic: handle header tag for python imports
Fixes: PYSIDE-1233
Change-Id: Id2b6e2a8b833da6ea4417d06643b2f7b045515a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-27 11:19:39 +01:00
Volker Hilsheimer
715468df40 Fix flaky QElapsedTimer::elapsed test case
Much of this test case was testing that the machine it runs on didn't
take more than an expected amount of time, which is an assumption that
won't hold in a virtual environment where the hypervisor might decide
to not allocate any CPU time to the machine at certain times.

Instead, take the samples that we want to compare with once, then
use them as reference for further comparisons.

Also, split the test in two, with the comparison operators and msecsTo
test moved into a separate test function.

Change-Id: I7db12b8e02552f4d63af933c1b0fee9d62b591eb
Fixes: QTBUG-58713
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-27 10:36:57 +01:00
Oliver Wolff
529cfe4e22 qwindowswindow: Fix screen changes between different DPI screens for native windows
When asynchronous events are used for notifications about screen changes
it is possible that we run into a race condition where the scale factor
has not yet been updated for the new screen. This results in a wrong
geometry being set for the window that is moved between the screens.
We do not have that problem with synchronous events.

Change-Id: I4eb6d2a7cb49517d271901b479f973e273a0926a
Amends: 7eed1e40d4
Task-number: QTBUG-65580
Fixes: QTBUG-82312
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-27 09:32:13 +00:00
Volker Hilsheimer
6324873543 Stabilize task255529_transformationAnchorMouseAndViewportMargins
This test doesn't test whether window activation works, so there is
no reason to fail the test if it doesn't. Instead, abort the test, so
that we can record it as a skipped test.

Change-Id: Ia44308ef17f110d40c6455d7ee85d90914face4f
Fixes: QTBUG-22455
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
2020-02-27 10:24:09 +01:00
Lars Knoll
e30aa59a89 Fix a quadratic behavior in the BiDi algorithm
Reset the lastETPosition after we changed DirET to DirEN,
to avoid iterating over the same set of characters many times.

Change-Id: Ib4113d0ba87ad70fc6bb386632eb094f943c080d
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-02-27 09:59:08 +01:00
Allan Sandfeld Jensen
25677ec4b2 Fix bounding box of zero-width entities in QFontEngineFT
Freetype can give us non empty bounds for zero-width characters,
this change just makes us skip metrics of characters already found to
not contribute to text advance. The coretext and windows
font-engines already uses the already calculated advance.

Change-Id: I82b3521a4fb92614be509be5982cd5ab9c1eb7de
Fixes: QTBUG-58854
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-02-27 08:59:08 +00:00
Kai Koehne
d32a6793a4 MinGW: Fix debug-and-release configuration
Make sure that, if Qt was configured with -debug-and-release, winmain
and user apps are generated by default in debug-and-release mode, too.

This amends 9b4ec1393f .

Change-Id: I0f169d63ca98c9bde41114225004a0844425db33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-02-27 09:59:08 +01:00
Alexandra Cherdantseva
0efdf54a16 wasm: fix texture leak when window is destroyed in a different context
Reproduce:
Show first window in first canvas;
Show second window in second canvas;
After screens are rendered destroy first window in first canvas

Change-Id: Ifbeb4824c1fdedecf24d5d20e58613d15c066420
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-02-27 01:53:57 +03:00