Commit Graph

3248 Commits

Author SHA1 Message Date
Andre Hartmann
f98ee77cd3 QByteArray: toInt() and toDouble() ignore surrounding whitespaces
[ChangeLog][QtCore][QByteArray] QByteArray::toInt(),
QByteArray::toDouble() and the other number conversion functions
now ignore leading and trailing whitespaces, as their QString
counterparts already did. For consistency reasons, the same
behavior was added to qEnvironmentVariableIntValue() also.

Task-number: QTBUG-66187
Change-Id: I8b5e478ea8577b811d969286ea9e269f539c1ea4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-07 19:58:18 +00:00
Simon Hausmann
42cc42acae Fix QString::localeAwareCompare with composed/decomposed strings on macOS
Similar to commit cd64a96b31 we also need
to normalize the strings before comparison in order to be compliant with
the ECMAScript test suite.

This patch also adds the remaining test cases from
built-ins/String/prototype/localeCompare/15.5.4.9_CE.

Since the same tests are also failing with strcoll/qt_compare_strings,
this simplifies the code to always normalize except when using ICU
(which gets it right by default).

Change-Id: I16b32da7fc70dc7e6725c49f66fe9941d0bf3a47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-07-06 20:49:29 +00:00
Thiago Macieira
340472534c QCborValue: refactor extended types so isTag() is true
This makes QCborValue more future compatible, as code written today for
tags that QCborValue does not recognize will continue to work if
QCborValue gains support for it in the future.

This change also obviates the need for reinterpretAsTag(), which I had
not written unit tests for as I knew this change was coming.

Change-Id: I052407b777ec43f78378fffd15302bdc34f66755
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-05 14:56:12 +00:00
Thiago Macieira
d0427759c6 Add qbswap for a memory region
The compiler was generating some vectorized code for qresource.cpp but
it wasn't very efficient. So improve upon it and make use in other
places where we read UTF-16BE strings.

[ChangeLog][QtCore] Added an overload of q{To,From}{Big,Little}Endian
that operates on a memory region.

Change-Id: I6a540578e810472bb455fffd1531fa2f1d724dfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-07-04 03:04:40 +00:00
Thiago Macieira
2bb44414ff QCborArray & Map: implement efficient take() / extract()
Questions:
 1) should QCborMap::extract return value_type (a pair) instead of just
    the value?
 2) should the both return the iterator to the next element too, like
    erase()?

Change-Id: I052407b777ec43f78378fffd15302a9c14468db3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-04 03:04:21 +00:00
Thiago Macieira
fcb0f68e77 CBOR: Complete the conversions between CBOR, JSON and Qt meta types
Change-Id: I56b444f9d6274221a3b7fffd150d3130db6ef1a0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-04 03:04:17 +00:00
Thiago Macieira
6c64a9b2d2 Metatype: make the Qt CBOR value-like types built-in meta types
This change only adds them to the registry and reserves the IDs. The
next commit will handle conversions.

Change-Id: I56b444f9d6274221a3b7fffd150d2d49f40940c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-04 03:04:15 +00:00
Liang Qi
e3ed2281c0 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_dragging.mm
	src/plugins/platforms/ios/qiosinputcontext.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/tools/androiddeployqt/main.cpp
		Was moved from qttools into qtbase in 5.11.
		So re-apply 32398e4d here.
	tests/auto/corelib/global/qlogging/test/test.pro
	tests/auto/corelib/global/qlogging/tst_qlogging.cpp
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
	tests/auto/corelib/thread/qthreadstorage/test/test.pro
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qapplication/test/test.pro

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Done-with: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
2018-07-02 11:23:45 +02:00
Daniel Vrátil
35e005bc4f Fix metatype trait for types that are both QObject and Q_GADGET
Fixes ambiguous template instantiation for types that derive from both
a QObject and Q_GADGET. For such types we treat them only as QObjects
as they extend the functionality of the gadget.

Task-number: QTBUG-68803
Change-Id: Ic42766034e14e5df43c4e6f7811e2c0be1dc7e74
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-06-30 13:23:03 +00:00
Mårten Nordheim
0ac09c40f2 Android: Pass tst_qlibrary
To make the minimum amount of changes:
- Extract the library files into the expected hierarchy.
- Introduce a variable with the path to the directory.
- Make the static function a member function so it can use the variable

Change-Id: Ibf3106c3606d198a8deb8cb2a5cbde57207221c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-29 19:02:09 +00:00
Oliver Wolff
40668b82f4 tst_qfile: Do not build helper application for winrt
The existence of the helper application confuses Coin which will
result in an error.

Change-Id: I3edf3f27acbe133b180d41a8ae950991e9a5b5da
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-06-28 15:44:03 +00:00
Oliver Wolff
63f78e41dc tst_qthreadstorage: Fix execution for WinRT
Not putting executables into debug/release subdirectories leads to the
WinRT AppxManifest being overwritten by the wrong configuration. When Qt
is configured with -release for example, it was possible that the debug
manifest (Manifest files are always created next to the target) is
written last and thus contains debug VCLibs as a dependency.

Additionally the test was changed in that way, that the resulting file
system structure (having helper and test application in a "top level"
debug and release folder) is the same structure as in tst_qobject.

Change-Id: I53d5238ff36706eb9c6f8eb04b954ec595ca30de
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-28 15:44:00 +00:00
Oliver Wolff
8f143c75f0 tst_qfile: Fix execution for WinRT
Not putting executables into debug/release subdirectories leads to the
WinRT AppxManifest being overwritten by the wrong configuration. When Qt
is configured with -release for example, it was possible that the debug
manifest (Manifest files are always created next to the target) is
written last and thus contains debug VCLibs as a dependency.

Additionally the test was changed in that way, that the resulting file
system structure (having helper and test application in a "top level"
debug and release folder) is the same structure as in tst_qobject.

Change-Id: I55078563304959c41e0dd9bb7bb91a6fc51e005a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-28 15:43:58 +00:00
Mårten Nordheim
8757e6fee1 Android: Make tst_qfile pass
By disabling the "stdinprocess"-related tests/code...

... but differently. After fixing my earlier mistakes I'm getting
segmentation faults when it executes a couple different library calls
after the QProcess object has started.

Task-number: QTBUG-68596
Change-Id: Id42a1f939c000754a187dee90c4a4cdfec816232
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-28 07:31:27 +00:00
Mårten Nordheim
d420987d54 Android: fix tst_qlogging
The "app" subfolder was already excluded in the .pro-file but Android
supports QProcess, so lets include it in the build. Unfortunately it
currently has trouble and crashes (the child process or both processes).
So we skip those tests.

Task-number: QTBUG-68596
Change-Id: I2e6d0869c408bf08b22c02145db8ce522c64c617
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-28 07:29:30 +00:00
Mårten Nordheim
568ee7da5a Android: Pass tst_qlocale
To make it run we make sure it finds the syslocaleapp, however since it
causes a crash we skip the test that uses it...

"formatTimeZone" was failing, but it is the exact same issue as in
e08ba34f26, so we solve it the exact same
way.

Change-Id: Ifd5c796735775dad94acf55210cf18c0f4d375ca
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-28 07:27:22 +00:00
Mårten Nordheim
6ee26c543e Android: Pass tst_QUuid
Same issue as has been seen a few other places: path to executable being
wrong, and then a crash when the paths are fixed.

Change-Id: I77a596c6e52d2a02a69a6b9dfe91f878b3ffe07c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-28 07:12:47 +00:00
David Faure
8a73085a0d QSortFilterProxyModel unittest: add test for filtered-out-after-setData
The row names for this test were very unspecific.
After reverse-engineering what they are testing, I gave them proper
descriptive names, which allowed me to notice that there were tests
for "filtered in after sourceModel->setData" but not for
"filtered out after sourceModel->setData".

Change-Id: Ib79108db803ae77fb65d29cf0c0ef96c26655980
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-06-28 07:00:00 +00:00
Giuseppe D'Angelo
aaf60da01c QRegularExpression: fix compiler warning in test
QTest::addRow expects a format specifier; this usage makes GCC complain
with -Wformat-security. Use the "old" newRow call instead.

Change-Id: Ieed8e4f64ff5e3d0d4e87325629d20ed6839ff9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-27 17:52:45 +00:00
Mårten Nordheim
7995540292 tst_qthreadpool: Skip "stackSize" if unsupported
If you're on a Unix platform which don't have the necessary defines then
the thread will never be launched due to an error. Skip the test
instead.

Change-Id: I83159988b8f330a750c7aa328a8805e4fa478070
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-27 17:40:28 +00:00
Thiago Macieira
10e5ec2557 QByteArray: implement qstricmp with SSE 4.1
Using SSE 4.1 because of the need for PMINUB.

Change-Id: Ib48364abee9f464c96c6fffd152ebd3f8ea7fe94
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-27 16:29:14 +00:00
Simon Hausmann
cd64a96b31 Fix QString::localeAwareCompare with composed/decomposed strings on Windows
With ICU and on macOS it appears that the comparison is done on a
canonical form, while CompareString(Ex) does not do that, as the added
test verifies. Explicit normalization fixes that.

As a bonus, this also unifies the code path between regular Windows
and UWP by unconditionally using CompareStringEx (which requires
Vista or later).

This issue surfaced while running the ECMASCript 6 Conformance Test
Suite in QtQml.

This re-uses the existing test for localeAwareCompare, which was
disabled on Windows, macOS and Linux with ICU (the common case).

Change-Id: I52440fce60b54745ead1eff005ec51e98e2a79ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-06-27 16:21:22 +00:00
Oliver Wolff
00d9ade6e6 tst_qlogging: Fix execution for WinRT
Not putting executables into debug/release subdirectories leads to the
WinRT AppxManifest being overwritten by the wrong configuration. When Qt
is configured with -release for example, it was possible that the debug
manifest (Manifest files are always created next to the target) is
written last and thus contains debug VCLibs as a dependency.

Additionally the test was changed in that way, that the resulting file
system structure (having helper and test application in a "top level"
debug and release folder) is the same structure as in tst_qobject.

Change-Id: I034752b4e5d22b98f6def95fb53c2b1947dded03
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-27 16:06:01 +00:00
David Faure
27ea5a65dd QAbstractItemModelTester: fix out-of-bounds index() calls
When removing rows, the tester is looking at the data of the row
"just before" and the row "just after" the removed rows, to see if
they are still the same at the end of the removal operation.
Guard this with bounds check, in case there is no row just before
or just after.

This is the opportunity to use modeltester in tst_qidentityproxymodel,
which was already a testcase for removing the only row in a given parent.

Change-Id: Iec8228c16b9c670b794e2665356d153679178494
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-06-27 10:11:35 +00:00
Mårten Nordheim
3079b3433d Android: tst_qtimezone: Blacklist a bunch
Task-number: QTBUG-69122
Task-number: QTBUG-69128
Task-number: QTBUG-69129
Task-number: QTBUG-69131
Change-Id: Ida626a6675764e9554785b5e56cfba3ab7206f17
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-06-27 07:52:26 +00:00
Mårten Nordheim
da82bfd823 Android: tst_QTimeZone::transitionEachZone: skip 2 zones
When testing zones "America/Mazatlan" and "Mexico/BajaSur" the test
crashes from an assert. Skip testing the zones for now.

Task-number: QTBUG-69132
Change-Id: I595089647792e9a2c094d63cb837584b8cdc9cb9
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-06-27 07:52:10 +00:00
Oliver Wolff
4d7137c4a0 tst_qobject: Fix execution in debug&release shadow builds
The previous approach of having the signalbug helper in a subdirectory did
not work for shadow builds, as QFINDTESTDATA would not find that dir. By
putting both test and helper into the same directory, the helper will be
found in the test's current working directory.

The second problem was that not putting executables into debug/release
subdirectories might have lead to the WinRT AppxManifest being overwritten
by the wrong configuration. When Qt is configured with -release for
example, it was possible that the debug manifest (Manifest files are
always created next to the target) is written last and thus contains
debug VCLibs as a dependency.

Change-Id: Ia39315432860405642542449296c16dd2ae9fa9f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-26 10:56:31 +00:00
Edward Welbourne
cffa010d42 Kludge round Android's ignorance of some esoteric time-zone transitions
Skip a few tests that Android's time-zone information doesn't suffice
to get right.

Task-number: QTBUG-68835
Change-Id: Ibf8d213c96b29d74fc478a0ede686ae52b5200fb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-26 08:05:17 +00:00
Kari Oikarinen
1049d3f9db tst_QTimer: Replace unconditional qWait()s with QSignalSpy
Where possible. Sometimes the replacement is QTRY_COMPARE instead.

Also don't use QTestEventLoop directly when it can also be replaced with
QSignalSpy use.

Remove the TimerHelper class, since its uses can be done with QSignalSpy (and a
lambda when remainingTime is checked). Although checking static single-shot
timers still needs a target object, so use a stripped down version in those
tests.

remainingTimeDuringActivation() was not actually testing the repeating case, but
single-shot case twice, so fix that. In the repeating case the remaining time is
exactly 20 ms on my machine, but QEMU emulation seems to be slow enough for time
to advance before the lambda is executed, so relax the conditions.

Task-number: QTBUG-63992
Change-Id: Iae92ff7862a13d36e695eec63b54403ec872f2b4
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-06-26 05:51:15 +00:00
Liang Qi
c3059391fe Make tests compile for Android
This only enables compilation, it doesn't fix any test.

Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also
acdd57cb for winrt.

android-ndk-r10e is used to compile, see
http://doc-snapshots.qt.io/qt5-5.11/androidgs.html .

corelib/io/{qdir,qresourceengine} need to be fixed later.

Done-with: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-06-25 08:01:19 +00:00
Thiago Macieira
cad7100fda QByteArray: add compare() with case sensitivity options
Need to do the same for startsWith() and endsWith(). indexOf() is a lot
harder.

[ChangeLog][QtCore][QByteArray] Added compare(), which takes
Qt::CaseSensitivity as one of the parameters. This function is more
efficient than using toLower() or toUpper() and then comparing.

Change-Id: Ib48364abee9f464c96c6fffd152e69bde4194df7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-22 20:12:41 +00:00
Giuseppe D'Angelo
06af9a1e38 QRegularExpression: refactor pattern optimization
After the move to PCRE2, optimizing patterns has been a thorn in the
side due to the fact that PCRE2's JIT compiler modifies the pattern
object itself (instead of returning a new set of data, like PCRE1
did). To make this fit with the existing behavior, a read/write
lock was introduced, with the read part locking when matching and
the write when compiling (or JIT-compiling) the pattern.

This locking strategy however introduced a performance issue,
as we needed:

* to acquire a write lock to compile/optimize the pattern (incl. the
common case where the pattern was already compiled, so bailing out
immediately);

* to acquire a read lock during the actual match, to prevent
some other thread from optimizing the pattern under our nose.

This was due to the "lazy" optimization policy of QRegularExpression
-- optimize a pattern after a certain number of usages. The
excessive amount of locking effectively limited scalability.

Simplify the code, and drop that policy altogether: since JIT
compiling in PCRE2 is faster and pretty much "always recommended",
just always do it for any pattern (unless it gets disabled via
env variables) when compiling it.

This allows to go back to a plain QMutex, and now the actual
matching doesn't require acquiring any locks any longer. Of course,
there is still a mutex acquired just before matching for checking
whether the pattern needs recompiling in the first place; this can
probably be further optimized via double-checked locking (using
atomics), but not doing it right now.

This shift makes a couple of pattern options controlling
optimization useless, and allows to centralize the 3
QRegularExpression tests (which were actually the very same test,
just setting slightly different optimizations strategies).

While at it, install a stress-test for threading, with the idea
of running it under TSAN or helgrind to catch bugs in
QRegularExpression's locking.

[ChangeLog][Important Behavior Changes][QRegularExpression] Regular
expressions are now automatically optimized (including JIT
compiling) on their first usage. The pattern options
OptimizeOnFirstUsageOption and DontAutomaticallyOptimizeOption no
longer have any effect, and will get removed in a future version of
Qt. QRegularExpression::optimize() can be still used to compile and
optimize the regular expression in advance (before any match), if
needed.

Task-number: QTBUG-66781
Change-Id: Ia0e97208ae78255fe811b78029ed01c204e47bd2
Reviewed-by: David Faure <david.faure@kdab.com>
2018-06-22 19:43:54 +00:00
Oliver Wolff
e77352a680 tst_qresourceengine: Fix position of testqrc for builtin testdata
A change between 5.11 and dev has modified the position of testqrc
inside the resource list. Adapt accordingly.

Change-Id: I697103f4b8c9e93bb613e814c47a4e68e9a997ab
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-22 05:02:40 +00:00
Mårten Nordheim
06996e1d0e Android: fix qdiriterator test
... by adding a prefix to the resource.

On android there is a resource ("qpdf") which gets included in the root
in all applications, included from "src/gui/painting/painting.pri".
So we move the test data to a sub-folder.

Task-number: QTBUG-68596
Change-Id: I67f2ed79a32c68d9a76cafba8ef23fe0da7c0fe8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-21 14:14:45 +00:00
Mårten Nordheim
06044df0e3 Android: tst_qthread: terminate is not supported
"terminate" and "terminated" both fail on Android since
QThread::terminate not supported on Android. So we should skip them.

Task-number: QTBUG-68596
Change-Id: Id0d1dde2cfa02bb2978e5dd16087bf8f3bf112b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-21 14:14:27 +00:00
Edward Welbourne
9f8938b89a Cope if mktime() deems times in a spring forward gap to be invalid
In tst_QDateTime::springForward(), we test correct handling of times
in the gap; these are formally invalid and a mktime() implementation
may reasonably reject them causing our date-time code to produce an
invalid result.  So handle that case gracefully in the tests, only
insisting on consistency between the two ways of preparing the date.
In one test, package the repeated code I was going to adapt into a
macro to save repeitition.

Task-number: QTBUG-68832
Task-number: QTBUG-68839
Change-Id: Ib8a16ff007f4e75ab2ccff05b1ccf00a45e50dc8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-06-21 10:40:43 +00:00
Edward Welbourne
b248a35a09 Add Android to exceptions in tst_QDateTime::toString_textDate_extra()
Android doesn't use the proper zone-abbreviation, so just check it
starts with the right date-time.  Revised the way the #if-ery for that
is handled, to avoid repetition of the (now more complex) condition in
the two tests affected.

Task-number: QTBUG-68833
Change-Id: Iceb5469f46c69ba5cdbaf7ca050ad70f2bb74f44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-21 10:40:36 +00:00
Edward Welbourne
e08ba34f26 Cope with Android's lack of time-zone abbreviations
Have a test expect what it does produce rather than fail what we can't
fix.

Task-number: QTBUG-68837
Change-Id: Icda7bd9968682daf97d46d597f8bb0433560cde2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-21 10:38:09 +00:00
Edward Welbourne
67bbe59a37 Make some QEXPECT_FAIL()s consistent in form and content
They used different messages for the same excuse, which weren't well
worded in any case; and their #if-ery was differently decorated.

Change-Id: I28f5032693aff1036cb086ac4032c669110a5cb5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-06-21 10:37:56 +00:00
Joni Jantti
0d49ac0ffc Blacklist tst_QThread::create
This autotest fails on QEMU armv7 builds.

Task-number: QTBUG-68866
Change-Id: Idb4bf39712a22c40f6d779a46ad2dd1f456ef48b
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-06-15 09:13:04 +00:00
Edward Welbourne
91f3687ee5 Make QString's formatting of doubles be consistent with other places
QString::sprintf(), like the C printf-family, always includes two
digits in any exponent it outputs.  Up to 5.6, number() and arg()
taking a double did the same; but changes at 5.7 to enable opting out
of the leading zero this implies for a single-digit exponent
accidentally opted out of it in args() and number().  This commit
fixes number() and arg() to include QLocaleData::ZeroPadExponent in
the flags they pass down to the C locale's doubleToString(), restoring
the prior behavior, including consistency with sprintf().

[ChangeLog][QtCore][QString] Formatting of doubles with single-digit
exponent, by number() or args(), now includes a leading zero in that
exponent, consistently with sprintf(), as it did up to 5.6.

Task-number: QTBUG-63620
Change-Id: I10c491902b8556e9f19e605177ead8d9fd32abd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-06-14 09:13:36 +00:00
Tony Sarajärvi
d2d87e6a9f Extend blacklisting of QSemaphore tests to macOS 10.13
Task-number: QTBUG-58745
Change-Id: Iad16beef04a7b52786b5415944d582d33b1120c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-11 15:07:00 +00:00
Thiago Macieira
c4ed96513e QCborValue: add support for QVariant and JSON conversions
Plus QStringList.

Change-Id: I39332e0a867442d58082fffd1508dfb9b540af23
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-08 07:46:41 +00:00
Liang Qi
49c9377421 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-06-08 07:46:35 +00:00
Thiago Macieira
92e472302a Long live DOM API for CBOR!
This is very similar to QJsonDocument, but there's no QCborDocument.
QCborValue is that.

[ChangeLog][QtCore] Added QCborValue, QCborArray and QCborMap, classes
that permit DOM-like access to CBOR data. The API is similar to
QJsonValue, QJsonArray and QJsonObject, respectively.

Change-Id: I9741f017961b410c910dfffd14ffca50dd8ef3ba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-08 07:46:29 +00:00
Liang Qi
096e37910d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/kernel/qeventdispatcher_cf.mm
	src/gui/kernel/qguiapplication_p.h
	src/gui/kernel/qwindowsysteminterface.cpp
	src/gui/kernel/qwindowsysteminterface.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/qioseventdispatcher.mm
	src/plugins/platforms/windows/qwindowsdrag.h
	src/plugins/platforms/windows/qwindowsinternalmimedata.h
	src/plugins/platforms/windows/qwindowsmime.cpp
	src/plugins/platforms/winrt/qwinrtscreen.cpp

Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
2018-06-07 19:10:53 +02:00
Thiago Macieira
91e1356335 QCborStreamReader: use QByteArray directly if possible
QIODevice represents considreable overhead, even with just QBuffer, for
parsing simple things. Benchmarking showed it was spending 25% of the
parsing time inside one QIODevice function or another. So this commit
accomplishes two things:

1) it increases the buffer size from 9 bytes to up to 256, which should
   reduce the number of calls into the QIODevice
2) if the source data is a QByteArray, then use it directly and bypass
   the QIODevice, thus increasing performance considerably

Change-Id: I56b444f9d6274221a3b7fffd150c531c9d28e54b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-06 17:48:00 +00:00
Edward Welbourne
af928dd160 tst_qstandardpaths: #if-out a function only used within #if-ery
Avoids an unused function warning.

Change-Id: Id221595920e9a34eb83b66fe123d664f60fcae05
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-31 15:50:17 +00:00
Allan Sandfeld Jensen
d517d5428c Use qFuzzyCompare instead of qFuzzyIsNull in QPointF ==
qFuzzyIsNull has a fixed range, where qFuzzyCompare can tell if numbers
are different in a more relative range. Without it QPointFs that are
heavily scaled will be interpreted as identical, when they are quite
different at their own scale.

Task-number: QTBUG-60359
Task-number: QTBUG-62161
Change-Id: Ic4ba90e9e994aedff5548d690f053eb309b0a60b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-30 08:28:11 +00:00
Mikhail Svetkin
6b98d97670 macOS: Fix QFileSystemWatcher to watch paths with the same prefix
It happens because our filesystemwatcher thinks it is subdirectory and not
two different paths

Task-number: QTBUG-60676
Change-Id: Ic753e9481cb26303a030044e0a5ab4d703bc529f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-05-29 06:32:46 +00:00