Commit Graph

3871 Commits

Author SHA1 Message Date
Cristian Adam
40f4b3de1a qeasingcurve/tst_qeasingcurve: Fix for MinGW 8.1 x86
Test fails on MinGW 8.1 x86, but not on MinGW 8.1 x86_64.

Task-number: QTQAINFRA-3304
Task-number: QTBUG-69947
Change-Id: Ie9a35bd6d5a8481028cd0ea426d1cf00bd7cf093
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-20 07:56:53 +01:00
Fabian Kosmale
6db55e3451 QSequentialIterable: Treat sets as appendable
QSet and std::(unordered_)set were so far not treated as appendable, as
they lack a push_back method. We do however need support for this in
declarative to enable converting back from QJSValue arrays to sets.
We achieve this by testing for and using the insert method. While vector
has also such a method, it doesn't take a single value, but rather a
position or iterator + value, so the template specialization is not
ambiguous.

Task-number: QTBUG-82743
Change-Id: I74fc7b1b856d9bcd38100b274ba2b69578ea8bbb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-18 09:54:19 +01:00
Cristian Adam
7150b07041 QLocale: Fix test on MinGW 8.1.0 32 bit
The call of _control87 would crash because of the previous test.

Change-Id: I254efe9c2e9892a473a02663e5ff7016791d5d6d
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2020-03-17 15:35:34 +01:00
Edward Welbourne
54f8be6cc0 Update UCD to Revision 26
Include WordBreakTest.html, since a test uses sample strings from it,
albeit without actually reading the file.

Had to comment out more of the new tests, as at Revision 24, pending
an update to harfbuzz and the text boundary detection code.

Task-number: QTBUG-79631
Task-number: QTBUG-79418
Task-number: QTBUG-82747
Change-Id: I0082294b09d67ffdc6a9b5c15acf77ad3b86f65f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-14 11:26:59 +01:00
Sona Kurazyan
0ae6803d39 Try to stabilize flaky test cases of tst_qsequentialanimationgroup
Use QTRY_COMPARE in the flaky tests instead of waiting.

Change-Id: Ic18fc5fde3fa47f3b3ef21e6acd876bd6990981d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-12 09:40:43 +01:00
Qt Forward Merge Bot
116d68f105 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/plugin/qlibrary.cpp
	src/corelib/plugin/qlibrary_unix.cpp
	src/corelib/plugin/qpluginloader.cpp

Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
2020-03-11 11:27:49 +01:00
Jarek Kobus
50d2acdc93 Add default arguments to QPainterPath methods using transform
Fixes: QTBUG-82602
Change-Id: Id82f145ffb33e6d4ef9b81282ad14657b1c8fbd0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-06 21:09:48 +01:00
Sona Kurazyan
249a2e3271 Disable warnings for the deprecated QLinkedList
QLinkedList has been deprecated, but we still need to test it. Suppress
the warnings for QLinkedList used in tests. Note, that I had to move
some of the test code, to avoid repeating
QT_WARNING_PUSH/QT_WARNING_POP everywhere.

Change-Id: I4203b3ef50045c4f45475a08638dbdc60f68761d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-06 09:50:35 +01:00
Marc Mutz
16f927a4f1 QLoggingRegistry: use QStringView/QLatin1String more
- QLoggingRule::parse() and the ctor take pattern as QStringView

- parseNextLine takes lines as QStringView and produces the pattern as
  QStringView for QLoggingRule

- (setContent has to wait for QStringTokenizer)

- QLoggingRule::pass()'s first argument is always QLatin1String, so
  take it as one

Use chopped() more, add a std::move().

Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-05 13:03:13 +02:00
Marc Mutz
c58249c327 tst_qstringapisymmetry: start testing char16_t, too
No surprises, as char16_t is transparently handled by QChar overloads.

Ok, one surprise: we seem to have QChar <> QByteArray relational
operators, but they don't work for char16_t. Probably members of
QChar, so LHS implicit conversions are disabled. Didn't investigate,
because it needs to be fixed at some point anyway, but that point is
not now.

Change-Id: I74e1c9bdd168e6480e18d7d86c1f13412e718a32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-05 10:51:39 +03:00
Marc Mutz
50f865e33f tst_qstringapisymmetry: fix indexOf/contains/lastIndexOf tests
... to not fold QChar tests into QString ones.

This is needed for adding char16_t tests.

Change-Id: I2507d7d68a39ff96cf033eadde10e383dc976dda
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-05 07:50:33 +00:00
Marc Mutz
b2f79cceb1 QLatin1String/QStringView: add (missing) member compare()
[ChangeLog][QtCore][QLatin1String] Added compare().

[ChangeLog][QtCore][QStringView] Added compare() overloads
taking QLatin1String, QChar.

Change-Id: Ie2aa400299cb63495e65ce29b2a32133066de826
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-05 07:50:02 +00:00
Marc Mutz
728cc964f3 QString/QByteArray: make all symmetry-checked member-compare() combinations noexcept
In QByteArray, they were just not marked as such.

In QString and QStringRef, the implicit conversion from QChar to
QString would destroy it. Add a QChar overload, delegating to
QStringView.

Added docs for the new overloads, copying from the nearest neighbor so
as to not look out of place. All string classes use different wording
for these functions. A cleanup of this state of affairs is out of the
scope of this patch.

Change-Id: I0b7b1d037aa229bcaf29b793841a18caf977d66b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-05 07:49:40 +00:00
Volker Hilsheimer
d678827f11 Un-blacklist QElapsedTimer::elapsed test
The test was fixed and metrics show no flaky failures anymore.

Task-number: QTBUG-58713
Change-Id: I50c0844db099f45bb5b7ca51a510bf0318554c44
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-04 10:04:54 +01:00
Thiago Macieira
ef92ac5636 QLibrary: stop setting errorString after resolve()
resolve() is technically thread-safe if the library has been loadaed. We
don't promise that, but it's there. More importantly, because
QLibraryPrivate is shared among QPluginLoader and QLibrary that point to
the same file, we can't thread-safely set the error string.

[ChangeLog][Important Behavior Changes] QLibrary::resolve() will no
longer set or clear the error string based on the success of finding the
symbol. The error string will reflect the result of loading the library.

Change-Id: I46bf1f65e8db46afbde5fffd15e1a4f4c2713c17
Reviewed-by: David Faure <david.faure@kdab.com>
2020-03-03 14:36:30 -08:00
Ivan Čukić
14420b359b Add operator-> to the key-value iterator for QHash and QMap
This patch adds the arrow operator to the stl-like key-value
iterator (QKeyValueIterator) for QMap and QHash.

This allows using normal member access syntax it->first and it->second
instead of having to use (*it).first and (*it).second.

[ChangeLog][QtCore][Containers] Added operator-> to the key-value
iterator for QHash/QMap.

Change-Id: I9cfa6480784ebce147fcfbf37fec5ad0080e2899
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-03-03 20:25:19 +01:00
Edward Welbourne
466d32160a Suppress warnings where QString and its tests use SplitBehavior
This is a follow-up to commit 895939c7f9
to fix deprecation warnings it added.

Change-Id: I3d86655ec2c84c1bdcac9c70436075fc78f2f781
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-03 17:34:16 +00: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
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
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
Lars Knoll
5c6c0289f0 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4212d070d5752275085e754b96f0392113604dba
2020-02-27 14:22:01 +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
Volker Hilsheimer
8b9a025373 Make QDeadlineTimer test more resilient against VM starvation
Flaky fails in this test suggest that the VM on which the
test is executed does not get CPU resources allocated for enough time
to make this test pass. This change makes the test more resilient by
taking the measurements as quickly as possible.

In addition, use a sanity-check based on std::chrono APIs to abort the
test completely if we see that the clock has advanced too far to make
the following tests meaningful.

Change-Id: Ie6ac4ffb52f20e7774014f8222c9cd8f54d8a263
Fixes: QTBUG-64517
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-26 23:26:23 +01:00
Lars Knoll
fd4be84d23 Add an expansion limit for entities
Recursively defined entities can easily exhaust all available
memory. Limit entity expansion to a default of 4096 characters to
avoid DoS attacks when a user loads untrusted content.

Added a setter and getter to allow modifying the expansion limit.

[ChangeLog][QtCore][QXmlStream] QXmlStreamReader does now by default
limit the expansion of entities to 4096 characters. Documents where
a single entity expands to more characters than the limit are not
considered well formed. The limit is there to avoid DoS attacks through
recursively expanding entities when loading untrusted content. The
limit can be changed through the QXmlStreamReader::setEntityExpansionLimit()
method.

Fixes: QTBUG-47417
Change-Id: I94387815d74fcf34783e136387ee57fac5ded0c9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-26 22:08:38 +01:00
Marc Mutz
e5acaa12e3 QObject: treat T* -> bool conversions as narrowing
Following wg21.link/LWG3228, it was found that a proper variant fix
requires that T* -> bool conversions be treated as narrowing
conversions in subclause wg21.link/dcl.init.lst. wg21.link/P1957R2 was
accepted in Prague 2020 as a DR and retroactively applies to older C++
standards.

Since we hard-code the algorithm of [dcl.init.lst], we can and must
add this manually.

[ChangeLog][QtCore][QObject] For the purposes of
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT, pointer
(incl. pointer-to-member) to bool conversions are now considered
narrowing. This matches the resolution of a defect report in C++
itself.

Change-Id: Ifa9a3724c9c8ccd3dd6614928dbbe37477591dc1
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-02-26 07:48:47 +00:00
Qt Forward Merge Bot
226533fd85 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iad459349ea8b4090d79b4771bfff8f656a8a8189
2020-02-26 01:00:08 +01:00
Friedemann Kleint
3c4078ca02 tst_QSettings: Fix leaking registry key
On Windows, the test was leaking a registry key
HKEY_CURRENT_USER\Software\tst_QSettings_trailingWhitespace
Fix by using .ini-Format in the temporary directory created by the test.

Amends e66a878838.

Task-number: QTBUG-22461
Change-Id: If141a9e72e8faebc3fc46b94dab7b4b728a75292
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-25 20:16:20 +01:00
Volker Hilsheimer
1ce3585305 Detect double timer during single timeout in registerTimer test, and skip
We observe this happening on macOS in the CI system, and it might happen
if a VM doesn't get CPU cycles for long enough time so that two timers
time out. Then event processing will process two timer events, and we
overwrite the timerIdFromEvent with the second event.

Instead, skip the test when this happens.

This is an ammendment to 5c520f4b0a

Fixes: QTBUG-71751
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 67491e2df5)
Change-Id: I30eef8cfc94988e6cad500dd5e6722488c2985be
2020-02-22 02:52:36 +01:00
Volker Hilsheimer
c3951470ca Discover the conditions under which registerTimer is flaky, and skip
On macOS, the registerTimer test case fails frequently, and blocks
valid integrations. With this change we try to detect the condition
and skip the test.

Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5c520f4b0a)
Change-Id: I97644b5b4654b4c96fbc99858bbf191e6edb5977
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-22 02:52:24 +01:00
Liang Qi
b9585277e7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/tools/qlinkedlist.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmscreen.cpp

Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
2020-02-18 09:26:53 +01:00
Edward Welbourne
1c0b69eac5 Only read the first BOM as a BOM; the rest are ZWNBS !
QUtf32::convertToUnicode() was forgetting to set headerdone when it
dealt with the header (for contrast, Utf16::convertToUnicode() does).

Fixes: QTBUG-62011
Change-Id: Ia254782ce0967a6cf9ce0e81eb06d41521150eed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-14 19:13:37 +01:00
Volker Hilsheimer
67491e2df5 Detect double timer during single timeout in registerTimer test, and skip
We observe this happening on macOS in the CI system, and it might happen
if a VM doesn't get CPU cycles for long enough time so that two timers
time out. Then event processing will process two timer events, and we
overwrite the timerIdFromEvent with the second event.

Instead, skip the test when this happens.

This is an ammendment to 5c520f4b0a

Change-Id: Ibc1169b5458c8dce9d4fe9ce715f49c396e17b86
Fixes: QTBUG-71751
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-12 22:16:26 +01:00
Qt Forward Merge Bot
9a5df00a61 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8caee4d1ce0eed27d905194df3c3d46c5d07d2b0
2020-02-12 01:00:50 +01:00
Kai Koehne
e541a3f099 QTranslator: Expose language of translation file
This allows for instance to show the current UI language in the UI,
or to load additional translations that match the .qm file by other
means.

This is especially useful in the case of QTranslator::load(QLocale(),
...), in which case different language and country combinations might
be tried.

Another option is to inspect the file name via QTranslator::filePath();
however, this is more error-prone, and might also miss information
(if the .qm file name doesn't have a country suffix, or no suffix at
all).

Change-Id: I6f565d53d8f50e21241ccae6c4de264747ac8f81
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:14:55 +00:00
Kai Koehne
dce61f0450 QTranslator: Expose origin file of the translation
Task-number: QTBUG-36608
Change-Id: I8ef0968404370b8fc25dc8b4c1e2c9e4484ae55c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:14:48 +00:00
Dmitriy Purgin
9557715016 std::chrono overload added to QStateMachine::postDelayedEvent()
Some Qt classes already accept std::chrono durations in their methods
(see, for example, QTimer). The proposed change adds an overload
with std::chrono::milliseconds to QStateMachine::postDelayedEvent().

Change-Id: I360fd2bb54fedc7415e9ec17e096095be3604d41
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2020-02-10 15:04:39 +01:00
Marc Mutz
6b9a1824a4 Extend tst_qstringapisymmetry for member compare()
There were a few surprises:

- QByteArray::compare() are missing noexcept (will add)
- ibid., called with non-ascii content and CaseInsensitive fails
  (this was discussed on the ML, with tentative agreement that
  it's a feature, not a bug; waiting for QUtf8String(View) for a
  fix, then).
- As was the case when we did this exercise with the relational
  operators, QString(Ref)/QChar is not noexcept (will fix)

These have been QEXPECT_FAIL'ed.

Not much of the cartesian product is implemented at all, yet.  These
have been #ifdef'ed with NOT_YET_IMPLEMENTED to see what's still
missing.

Change-Id: I7d9b21e292b98f980aacdc6248e88188f7472ba2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-09 17:43:20 +00:00
Volker Hilsheimer
e79979ba40 On Windows 7, fall back to SHFileOperation to avoid confirmation dialogs
Moving a file to the trash should preferably done via IFileOperation.
However, the implementation on Windows 7 ignores the operation flags
that request the shell not to show any confirmation dialogs or other UI
elements.

SHFileOperation is an old API that doesn't show any UI, but has the
limitation that it doesn't report the location of the file in the trash
after the move. So an application cannot restore the file, but the user
can do so via Explorer.

Overall, the better compromise is to not have dialogs at the expense of
not being able to report the new path. This allows us to run the unit
test on Windows 7 as well.

Change-Id: Ib8e651a69e2c6750f668b52d2a70925d156cc8ae
Fixes: QTBUG-81927
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-07 12:21:13 +01:00
Volker Hilsheimer
5c520f4b0a Discover the conditions under which registerTimer is flaky, and skip
On macOS, the registerTimer test case fails frequently, and blocks
valid integrations. With this change we try to detect the condition
and skip the test.

Change-Id: Id2065f606abfd431971becf63034a4c1f0fdb9e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-07 04:51:16 +01:00
Edward Welbourne
26f6aa3e50 Configure the MS-Win long time format rather than assuming we know it
In tst_QLocale::windowsDefaultLocale(), we configure the long and
short date formats and the short time format eccentrically, then
verify that QLocale::system() does actually get these eccentric
formats. However, we did not configure the long time format (whose
MS-API name doesn't match that of the other formats), so had to rely
on a guess at the system locale's format. That, however, is not
robust; so now configure the long time format, too.

Removed a duplicated test, at the same time.

Fixes: QTBUG-36306
Change-Id: I04dc22c7eb1b58af55412b598873868f79e9c74f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-06 12:56:58 +01:00
Qt Forward Merge Bot
8ce0ad805d Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/network/ssl/qsslsocket_openssl_symbols.cpp

Change-Id: I8c13b5c48a8ecce96540b39c6d5f8ca146eb2339
2020-02-06 11:10:34 +01:00
Volker Hilsheimer
74a2467edd Add QFile::moveToTrash, which moves a file to the trash
Due to the nature of QFile just operating on a file path, this also
works for paths that are actually directories.

The test covers files from different locations on which this
operation should typically succeed, but tries to handle the case
where trashing files will fail because of the file system
structure.

On Windows 7, running the test will open a confirmation dialog as
the implementation of IFileOperation doesn't respect the various
flags. This might depend on the specific Windows 7 patch level,
and the option to always use SHFileOperation on that platform needs
to be evaluated further.

[ChangeLog][QtCore][QFile] Introduce QFile::moveToTrash to allow
applications to move files to the trash.

Change-Id: I45019040c25b30f7db293b6933c63aca2f319514
Fixes: QTBUG-47703
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-05 20:21:45 +01:00
Edward Welbourne
41b2c477b7 Take care of NULL data from QStringView in QCollator
Back-ends need to catch NULL data so as not to call system APIs with
invalid pointers.

[ChangeLog][QtCore][QCollator] Fixed a regression introduced in 5.14.0
that caused QCollator not to operate with default-constructed QStrings
and print a warning on Windows.

Fixes: QTBUG-81673
Change-Id: I2eafe1e188b436afcca3cf2ecdf98bba707c44c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-05 10:23:43 +01:00
Volker Hilsheimer
336b3bb0dd Address failing test case for internal implementation of moveToTrash
This ammends 601ce9e08a, which added
a new test case for the internal Qt APIs. The test was not
getting executed by coin as it wasn't included in the io.pro file,
and trying to fix that generates link errors on Windows, since these
internal APIs depend on other internal APIs.

Short of bootstrapping much of QtCore into this test case, the only
sensible option is to remove this test case again, and cover the
testing when the public API is added in a follow up commit.

At the same time, address those failures that were discovered
on platforms that could build the test, and fix compilation on
iOS platforms in Coin.

Change-Id: Id31b43c9df9f205476c48bccb6b87c7a53ed15c5
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-04 11:58:56 +01:00
Qt Forward Merge Bot
97417e8f28 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	examples/widgets/widgets/imageviewer/imageviewer.cpp
	src/corelib/text/qchar.cpp
	src/corelib/time/qdatetime.cpp

Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
2020-02-04 10:44:00 +01:00
Edward Welbourne
71fa90a37c Enable system locale to skip digit-grouping if configured to do so
On macOS it's possible to configure the system locale to not do digit
grouping (separating "thousands", in most western locales); it then
returns an empty string when asked for the grouping character, which
QLocale's system-configuration then ignored, falling back on using the
base UI locale's grouping separator. This could lead to the same
separator being used for decimal and grouping, which should never
happen, least of all when configured to not group at all.

In order to notice when this happens, query() must take care to return
an empty QString (as a QVariant, which is then non-null) when it *has*
a value for the locale property, and that value is empty, as opposed
to a null QVariant when it doesn't find a configured value. The caller
can then distinguish the two cases.

Furthermore, the group and decimal separators need to be distinct, so
we need to take care to avoid cases where the system overrides one
with what the CLDR has given for the other and doesn't over-ride that
other.

Only presently implemented for macOS and MS-Win, since the (other)
Unix implementation of the system locale returns single QChar values
for the numeric tokens - see QTBUG-69324, QTBUG-81053.

Fixes: QTBUG-80459
Change-Id: Ic3fbb0fb86e974604a60781378b09abc13bab15d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-02-03 15:34:02 +01:00
Vitaly Fanaskov
dd42e5d5e7 QSignalMapper: deprecate overridden signals
Task-number: QTBUG-80906
Change-Id: I9beab78d8fe8dfc712969f65792f50360a890287
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-02-01 21:23:44 +01:00
Kari Oikarinen
89f443dfbc QScopeGuard: Fix build failures with qScopeGuard()
Partially reverts 4f077b7e5f.

Can't overload with forwarding references and lvalue references. Use a single
forwarding reference overload, but take care of not trying to create a
QScopeGuard of reference type and forward instead of moving.

Add tests to ensure calling with both lvalues and rvalues is possible.

Change-Id: Ia034afe0a8feb08246c2c7c154a85cae37421c98
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 11:07:08 +02:00
Sze Howe Koh
e6f479a830 tst_QDataStream::readQCursor(): Replace deprecated QCursor API
Task-number: QTBUG-48701
Change-Id: I4205d278b1cd6b088f8f58020f6a5e49a7f1ca33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-01 07:31:02 +08:00
Allan Sandfeld Jensen
c76dd72dc6 Add a constructor for QRunnable from anonymous functions
This makes it easier to create one without having to create
a derivative class. The patch also adds a path to avoid using
QRunnable directly in QThreadPool.

Change-Id: I9caa7dabb6f641b547d4771c863aa6ab7f01b704
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-01-31 19:20:43 +01:00