Commit Graph

49666 Commits

Author SHA1 Message Date
Ivan Solovev
3d780c0d70 QtConcurrent: filter/map reduction without default ctor
Previously a default constructor was required for the result type
of mappedReduced() and filteredReduced(), even if a default value
was provided.

This patch fixes the problem.

The issue was in the ResultReporter type, that was calling
QList::resize() to adjust the size of expected reported results.
A default-value parameter was added to the class, so that
a corresponding overload of QList::resize could be invoked.

Task-number: QTBUG-88452
Change-Id: I51113753e314d76aa74d201b5a7e327a6ca75f47
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-12-04 15:36:50 +01:00
Allan Sandfeld Jensen
0c19e3f703 Fix QImage::setPixelColor on RGBA64_Premultiplied
QColors were not premultiplied before being set.

Pick-to: 6.0 5.15 5.12
Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-04 15:09:47 +01:00
Edward Welbourne
0a01396e60 Purge double-spaces in qvectornd.cpp sentence-ends
Change-Id: I4b5692334a12374b8a6b4910d411d0eab240ce4b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-04 15:09:47 +01:00
Edward Welbourne
c3ec3edb81 Indicate the limited locale selection in the POSIX backend
Change-Id: I82798de7ff313121144798969eed85c23e852d10
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-04 15:09:47 +01:00
Edward Welbourne
2b7c74d5ff Enable testing for whether a calendar registered its primary name
In registerAlias(), return true if this instance is already registered
with the given name.

Previously there was no way for a QCalendarBackend to tell whether its
primary name registration had succeeded, during instantiation (other
than by devious hackery using a QCalendar instance with the name and
some form of back-channel in the instance).

Use this in backendFromEnum() to catch cases in which (e.g. due to a
race condition) a new instance isn't the one that got registered.

Pick-to: 6.0 5.15
Change-Id: I468ac364a68bf3574cd7f8b8b1e672d8fd969111
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-04 15:09:46 +01:00
Andy Shaw
94c3c7a491 macOS: Make sure that the reserved characters are not escaped
The URL for the PAC proxy that is passed needs to be preserved for the
main URL part and not entirely percent encoded, only the query part
typically needs to be encoded. So use toEncoded instead for a URL to
ensure they are not percent encoded. This amends
c163ec1dbf

Pick-to: 6.0 5.15
Change-Id: Ie41ab55f71be8e25c18775e61ce7b4d110c2ddbf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-04 15:09:46 +01:00
Giuseppe D'Angelo
a1a55d5b93 QTestLib: add a abort-on-fail environment variable
When debugging a spurious failure it's extremely useful to
run the test repeadtly into a debugger until a failure appears.
When that happens, one wants to immediately start debugging.

In so far, this has only been possible by placing breakpoints
inside Qt itself (when a failure is logged). Add another way:
an env variable, similar to QT_FATAL_WARNINGS, that makes
any failure fatal (terminate() gets called. Bonus: you can
control the termination handler!)

[ChangeLog][QtTestLib][QtTest] When the QTEST_FATAL_FAIL
environment variable is set to a non-zero value, a test
immediately aborts its execution. This is useful to debug
intermittent failures.

Change-Id: If2395f964ea482c30b8c8feab98db7fdee701cd3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2020-12-04 14:09:46 +00:00
Fabian Kosmale
bc093cd294 QInputDevice: Parent default keyboard to core app singleton
With this we can avoid leaking the QInputDevice which is created when
the platform plugin does not provide any. The onwership is solved in a
similar way as in the plugins, except that here we have no parent which
really fits, so we use QCoreApplication::instance instead.

Pick-to: 6.0
Change-Id: I77a212fb592ba3d5a42b2ecd486763e3b4d3410e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-12-04 15:09:46 +01:00
Shawn Rutledge
94dfb18865 Make qDebug output for QTabletEvent similar to that for QMouseEvent
Reuse operator<<(QPointingDevice*) and move the button state right after
the event type.  Now it's easier to follow when a QTabletEvent is not
accepted and a mouse event is synthesized:

qt.quick.pointer QQuickWindowPrivate::deliverPointerEvent - delivering
  QTabletEvent(TabletPress LeftButton pos=100,100 z=3 xTilt=25 yTilt=35 pressure=0.5
     dev=QPointingDevice("Wacom Intuos3 6x8 Pen stylus" Stylus id=13 seat=30002 ptrType=Pen
       caps=Position|Pressure|MouseEmulation|Hover|XTilt|YTilt uniqueId=499602d2))
qt.quick.pointer QQuickWindowPrivate::deliverPointerEvent - delivering
  QMouseEvent(MouseButtonPress LeftButton pos=100,100 scn=100,100 gbl=3739,1029
    dev=QPointingDevice("Wacom Intuos3 6x8 Pen stylus" Stylus id=13 seat=30002 ptrType=Pen
      caps=Position|Pressure|MouseEmulation|Hover|XTilt|YTilt uniqueId=499602d2))

Change-Id: If22f1c07d32f595d0444513b49635218c08a300d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-04 11:22:38 +01:00
Alexandru Croitor
2f1c087573 CMake: Fix conditions for some subarch features
The AES and SHA features were checking for the wrong TEST_subarch_foo
variables.

Pick-to: 6.0
Task-number: QTBUG-87376
Change-Id: I46cd14d98832529aebac22cfcb01180330c5e091
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-04 11:22:38 +01:00
Alexandru Croitor
88e9e88a26 CMake: Mark qt-cmake-standalone-test as an executable on Unix
The source permissions are transferred when using configure_file for
non-prefix builds. This allows running qt-cmake-standalone-test in
both non-prefix and prefix builds.

Change-Id: I38829901d0bd4dfc4b89c665169798052b218fb0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-04 11:22:38 +01:00
Giuseppe D'Angelo
9afb3506b3 tst_qmakelib: link to QtCore's private API
Just like it was done in the .pro file.

Pick-to: 6.0
Change-Id: I7def52127f4bab6f0ef490ac7eee2de2da479352
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-04 11:22:38 +01:00
Mårten Nordheim
710886fbdd QSocks5SocketEngine: fix reference to dangling data
Following a41c61fb2d QIODevice may try to
copy the QByteArray itself (rather than the data it points to). This can
lead referencing dangling data when the QByteArray is initialized with
raw data.

Pick-to: 6.0
Change-Id: I481695b33f251f750ef482d72b81636f0d4bf462
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-04 11:22:38 +01:00
Allan Sandfeld Jensen
47923f7d47 Improve documented function argument names
Make them less \a fun.

Pick-to: 5.15 6.0
Change-Id: Ief9a572dcbeb029b18b352c89551963bade90198
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-04 11:22:37 +01:00
Fabian Kosmale
e236faa75f QBindable: Disallow mutation if read-only
If a QBindable is created from a computed property, it is not possible
to actually set a value or a binding. If we try to do it anyway, we'd
get a crash. Thus we now check whether the function pointer is null
before invoking it.

Pick-to: 6.0
Task-number: QTBUG-87153
Change-Id: I5bedb9080ccf79d9b8166b80d5733d095ed76f8d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-04 11:22:37 +01:00
Piotr Mikolajczyk
e1440dd7bc Android: Kill calls to deprecated func in API 29
Since API 29 functions:
 - getExternalStoragePublicDirectory
 - getExternalStorageDirectory
are deprecated and no longer return directly accessible path.

This patch replaces calls to those with suggested call to
Context.getExternalFilesDir(String)

Task-number: QTBUG-87803
Pick-to: 5.15 5.12 6.0
Change-Id: I36bc5d5b72a80017996445af0d577aacf5e112d3
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-12-04 06:29:07 +00:00
Christian Ehrlicher
6efe11dd75 Remove unneeded qatomic_msvc.h
Since Q_COMPILER_ATOMICS is defined for every supportied MSVC compiler
in qcompilerdetection.h, qatomic_msvc.h is not included anymore in
qbasicatomic.h and can be removed.

Change-Id: I6505da5d5e9f1c3f9a060ad30cabb4b652634aa3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-04 07:04:11 +01:00
Lars Knoll
57e9d9e38e Dont' return a const ref to QModelIndex
The conversion operator from QPMI to QModelIndex should return by
value, to hide implementation details and so that we don't have to
rely on a static empty QModelIndex.

Change-Id: I92b3f8451422f2b69bf31f28b387a124fd24ec46
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0cd2935ed9d772f0eb06d03201baabd60764ec80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 06:00:50 +00:00
Lars Knoll
6012285e7d Fix hashing of QPersistentModelIndex
The hash and equality operators used need to be consistent with
each other. Unfortunately, QPMI::operator==() is not suitable to do
this. So specialize qHashEquals() for QPMI.

Fixes: QTBUG-88966
Change-Id: If5f19a722ae9fc4e78e93537e7ea15726f148768
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 83e95956ed58e88b11e2cc3cb61c5beacb7985db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 06:00:38 +00:00
Lars Knoll
793dbd8ee6 Add a qHashEquals() method and use it to compare keys in QHash
In some cases, the default equality operator for a class is not suitable
for using in hashing (for example because it uses fuzzy comparisons).

Add a qHashEquals() method that by default uses the equality operator, but
allows to tailor the operations that should be used when using the class
as a key in QHash.

Task-number: QTBUG-88966
Change-Id: I346cf0e6e923277a8b42a79e50342a1c2511fd80
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5d8b586e73e37070b0303bee24372550854637eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 06:00:21 +00:00
Li Xinwei
013abe3206 CMake: Avoid MSVC C4996 warnings
The qmake build system defines _CRT_SECURE_NO_WARNINGS in
mkspecs/features/qt_module.prf, the cmake build system should do the
same thing in qt_internal_add_module().

Adding this definition can avoid warnings like:
warning C4996: 'strncpy': This function or variable may be unsafe.

As a special case, Bootstrap uses add_library() instead of
qt_internal_add_module(), so _CRT_SECURE_NO_WARNINGS should also be
defined in src/tools/bootstrap/CMakeLists.txt.

Pick-to: 6.0
Change-Id: Ic82193d177f82785fd84948efa78c49ca8d8db46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-04 13:54:49 +08:00
Alexandru Croitor
f071ba31b2 CMake: Fix arch parsing for oss-fuzz
I'll preface by saying, it's not clear to me why the behavior is
different.

Our qt_run_config_test_architecture function builds a target
executable, and then uses file(STRINGS) to try and parse out some
magic strings that we expect the executable to have (architecture,
abi, etc).

In qmake this was done by matching with a regular expression ending on
a \\0 null byte character.

In CMake, we do a string(FIND) and string(SUBSTRING until the end of
the line) on a *line* returned from file(STRINGS). Notably, I did not
find any regexp syntax provided by CMake to try and match a null byte
character.

Note the docs for file(STRINGS) implies to me that *lines* are
detected by looking for newline characters '\n'. The docs also
mention that binary data in the file is ignored. What's binary
data though?

If you open the executable with a hex editor, at least on macOS, the
strings we are interested in are indeed separated by null byte chars,
not newline chars.

On most platforms file(STRINGS) did end a line on the null byte
character.
Except, for some reason not when building Qt for the oss-fuzz project
with clang under Docker.

Calling message() on one of the lines prints a very long string with
null characters seemingly replaced with semicolons, and of course the
matched architecture string is wrong and fails configuration.

For *some reason*, if I add a "REGEX ==Qt=magic=Qt==" option to the
file(STRINGS) command, the captured output lines don't contain
semicolons even when building for oss-fuzz.

The extracted strings are then correct, and configuration succeeds.

Use the REGEX option workaround, with the aim to quickly fix Qt
building for oss-fuzz for 6.0.1 release.

Pick-to: 6.0
Fixes: QTBUG-89047
Change-Id: Iad11c1090c1187aadd39082f196050bf3290df95
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-04 06:14:03 +01:00
Volker Hilsheimer
ec1ac2f1b2 Fix compiler warning from discarded return value
Amend 53b7cb1bd7, match() is only used
to provoke data races.

Change-Id: Id20b11fedf7f20e74baab15bbb60c995c1a0c794
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-04 00:17:46 +01:00
Giuseppe D'Angelo
89def082c6 QTestLib: allow for non-zero values in env variables
The usual behavior for env variables is that any nonzero
value means "enable", so do the same for a couple of QTestLib
env vars. While at it: document them.

Change-Id: I854285df5d7af5be771f9d6532ddec5d8a6f8987
Pick-to: 6.0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-04 00:17:46 +01:00
Mårten Nordheim
a7610a0cf7 tst_qstorageinfo: Test the copy ctor
It was previously untested

Task-number: QTBUG-88183
Pick-to: 6.0
Change-Id: Icc59fc632957a75cac8c7f5e2a1aed88a1c9ff9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-12-03 23:17:46 +00:00
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
Alexey Edelev
af0a9375f3 CMake: Improve long paths handling for static builds
Use number-based naming of object libraries produced for generated
resources. This reduces path length of subdirectories for object
library targets.

Amends 08eb485a006dc2baca42eb280ae60e9f0fc00dff

Pick-to: 6.0
Change-Id: I1a449290e8a9b969601a1cc1abc6fdcfc0cd9454
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-03 20:21:35 +01:00
Andreas Buhr
604a8c7acc Fix documentation of QStringTokenizer
Documentation of QStringTokenizer was broken, mainly because most
parts of the interface were defined in base classes. This patch
gets those members into QStringTokenizer itself in order to document
them.

Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Id00a79db4b293958a9c5ed53a518a97721d228c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-03 20:21:35 +01:00
Andreas Buhr
d7828a5ed3 Remove non-existent function QApplication::desktop() from docs
The method QApplication::desktop() was removed. This patch removes
a line mentioning it in the documentation.

Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: I123e41c342d64da347b9bd59378e52a8e0301c1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 20:21:35 +01:00
Andreas Buhr
15cd7d7741 Fix documentation warnings about QCollator property
The documentation of ignorePunctuation in QCollator did not strictly
follow conventions, leading to warnings in building the documentation.
This patch fixes this.

Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Ia1273ec8e440099afe729b54423760ad5ac26290
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 20:21:34 +01:00
Joerg Bornemann
e32e4898dd CMake: Fix QMAKE_LIB_<NAME> variable names in module .pri files
QMake libraries that contain dashes are referenced by QMAKE_USE as is,
but the corresponding QMAKE_LIB_<NAME> variable must be normalized to
contain underscores.

Example from the qmake build:

./mkspecs/modules/qt_lib_waylandclient.pri
11:QT.waylandclient.uses = wayland-client xkbcommon wayland-cursor

./mkspecs/modules/qt_lib_waylandclient_private.pri
12:QMAKE_DEPENDS_WAYLAND_CURSOR_CC = WAYLAND_CLIENT
13:QMAKE_DEPENDS_WAYLAND_CURSOR_LD = WAYLAND_CLIENT
15:QMAKE_LIBS_WAYLAND_CURSOR = -lwayland-cursor

Pick-to: 6.0
Change-Id: If31bd45764d52f97d80d6388503008dc1ffb16ab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-03 17:18:23 +01:00
Friedemann Kleint
a5e2f2ddad uic: Do not generate QDockWidget::AllDockWidgetFeatures into code
The enumeration value was deprecated by
qtbase/f15aa1fd84e46dfc4d9a78b3a7ba482e42abd9c1 and removed in Qt 6.

Pick-to: 6.0
Task-number: QTBUG-89093
Change-Id: Iaf46adc1e1bd79e4aaab066c9fa4bf84a8ee34d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-03 17:17:03 +01:00
Fabian Kosmale
df8fbcf382 Avoid signed overflow in moc
moc's preprocessor needs to implement certain math operation to
correctly handle #if conditions. Unfortunately, its implementation is
not overflow safe. However, those are rare enough in practice that we
in general do not need to care about them.
This patch adds a workaround for one case where UBSAN run into an
overflow related issue.
A complete fix would require to make moc spec compliant (do math with
std::max_(u)int_t operands; always wrap on overflow) in all operations.

Pick-to: 6.0 5.15
Fixes: QTBUG-88825
Change-Id: Ic4d2cb097db2fa2f9d4681bbaab3068eaa2745aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-03 13:51:32 +01:00
Alex Trotsenko
9a161b6700 Fix event() chaining in QWinEventNotifier
We should return the result of the call of the base implementation for
all events that we did not handle. Also, QObject::event() does not
actually activate any filters, so the comment was inaccurate as well.

Change-Id: I9eb2f9a93a6b53a1afd035433615bcc0ee8cbf2c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-03 08:35:34 +00:00
Shawn Rutledge
6f694b7fe1 Remove QGuiApplicationPrivate::m_fakeTouchDevice
It is no longer in use.

Change-Id: I810a79c81fe49d855b31e992bf000166247791a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-03 09:22:12 +01:00
Karsten Heimrich
8df2bf0491 Fix QTranslator::load() search order not following uiLanguages order
Merge the exact and and fuzzy search loop. This way we prioritize
translations which match a more preferred language loosely over ones
which match a less preferred language exactly. This is likely what
most users want.

Pick-to: 5.15 6.0
Fixes: QTBUG-86179
Change-Id: Id1610c82a2e77edf9a5d4417968dcc4c307810d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-12-03 07:50:20 +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
bf92f0fee5 QHash: default the argument for the hash calculator helper
Just to be consistent with everything else.

Change-Id: I48ceb4bbc1cbf65b03caee77b7405cb585793248
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:52:28 +01:00
Giuseppe D'Angelo
06957af471 QDuplicateTracker: allow usage of qHash
The codepath using unordered_set forced the usage of std::hash,
which isn't provided by many Qt types. Instead, use the
brand new helpers in QHash that dispatch to qHash with a fallback
on std::hash.

Change-Id: I9185fe9c52de05c470afe7466007591977e65bb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:52:06 +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
Giuseppe D'Angelo
427da06414 QRE: discourage users from assuming that QRE stores the subject
When matching over a QString we store a (shallow) copy of it.
That has always been an implementation detail and people should've
never relied on it, but Hyrum's law, we don't want to actually
exploit this by NOT taking the copy.

Converesely, matching over QStringView already requires that
the string data is kept alive as long as QRE(Match) objects
are alive.

Add a doc note to give us the freedom to do the change in Qt 7.

[ChangeLog][QtCore][QRegularExpression] QRegularExpression takes
a shallow copy of a QString subject when matching over it. This
means that users can destroy or modify the string data while
still having match results over it. This behavior is deprecated;
in a future version of Qt, QRegularExpression will no longer
take a copy. Note that behavior has always been undocumented and
users were never supposed to modify a subject string while
match objects were alive on it. In practice, it's very unlikely
that your code is relying on the existing behavior.

Change-Id: Ibc5f900c09a007139fb12fc4d7f11e4a8f31bf38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:51:14 +01:00
Giuseppe D'Angelo
1ebccf3426 QString::fromUtf8: remove a stray cast to int
Change-Id: I0dba7ba130c3fa96eda63a0fa1a39c5f0bb863b7
Pick-to: 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:50:54 +01:00
Giuseppe D'Angelo
53b7cb1bd7 QRegularExpression: plaster some [[nodiscard]]
On some of the "most important" API.

Change-Id: I800b53bb7b9a95d0184f813e7ba501a7ebd485c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:50:46 +01:00
Giuseppe D'Angelo
553d4ec464 QString: plaster more and more [[nodiscard]]
The situation was quite inconsistent. Use the attribute more.

Change-Id: If21817b4c2ea1148ad4ad80e7a50fab721a58b65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-03 06:50:37 +01:00
Yuya Nishihara
d9a6517076 Dialog: Fall back to transient parent to make dialog window get centered
Unlike QWidget-based application, a dialog displayed in QML app doesn't
have QWidget parent, so it would be centered in the current screen.
Let's fall back to transient parent window if widgetParent() is missing.

It's tempting to rewrite adjustPosition() to not depend on QWidget at all,
but that seems not easy. Lookup path of window() and transientParentWindow()
is slightly different for example, and QWidget::pos() is used instead of
mapToGlobal({0, 0}) if the widget is embedded into a native window.

Fixes: QTBUG-63406
Change-Id: If72d90aee8d972240243184de4d3c09d77f704ff
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-12-03 14:43:42 +09:00
Qiang Li
d6dcf508a6 Adjust the format of code blocks in function mouseReleaseEvent
Pick-to: 6.0
Change-Id: I8441b1c4f22ec04e34e8c2c5e9ccc69d34c67e01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-03 02:19:15 +00: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
Andreas Buhr
c3ffa6036b Fix QSet::insert documentation
Documentation for QSet::insert was wrong, leading the warning
qset.qdoc:510: (qdoc) warning: clang couldn't find function when parsing
\fn iterator QSet::insert(const_iterator it, const T &value)
This patch fixes it.

Task-number: QTBUG-88533
Change-Id: I587cbae5674b9f38e37753a20c3c3f0d770980d6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-02 17:08:50 +00:00
Andreas Buhr
3c0614b779 Document QMultiHash::clear function
When QMultiHash derived from QHash, it inherited the clear function
and no separate documentation was necessary. Now, QMultiHash::clear
needs its own documentation. This patch adds it.

Task-number: 88533
Pick-to: 6.0
Change-Id: I93c59b66aa3d8ccf1888b6e24a4cc47004318e37
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-02 18:08:38 +01:00