Commit Graph

2617 Commits

Author SHA1 Message Date
Thiago Macieira
b1b53b7101 Revert "Add tests for QCollatorSortKey"
This reverts commit b0c1e07d64.
The unit tests it introduced trigger errors with the macOS and
Win32 implementations, which means the there's something seriously
wrong with either the API, our implementation or the tests.

Revert for now until this gets fixed. Blacklisting was also the
wrong tool to use. The tests should have used QEXPECT_FAIL.

Change-Id: Ida20c6bbe0c019835a22464535029585e8e1e367
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-12 08:15:48 +00:00
Marc Mutz
b0c1e07d64 Add tests for QCollatorSortKey
There weren't any, at all.

Testing on the CI showed that the implementation is broken on
macOS, and, to a lesser extent, on Windows, so blacklist the
failing tests until the implementation can be fixed. No need
to hold back testing the other implementations.

Task-number: QTBUG-58737
Change-Id: I9ae16ab778dbe2e95a6ca5e0bae00df4bad65cb2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-11 07:37:22 +00:00
Marc Mutz
0f2638c994 Blacklist tst_QElapsedTimer::elapsed() on Windows
This test was determined to be flaky on the CI.

Task-number: QTBUG-58713
Change-Id: Ie6e6a69b8ea625e3a3102c88d52f1f0fbec242aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-09 10:01:08 +00:00
Marc Mutz
9e5e30fa13 QStringMatcher: fix setCaseSensitivity() on a non-QString-backed matcher
When a non-QString-backed mode (via the (QChar*, int) ctor) was added
for Qt 4.5, the author forgot to adjust the setCaseSensitivity()
function.  It still uses q_pattern instead of (p.uc, p.len) as the
pattern for which to create the skip-table. Since there is no
setPattern() overload for this mode, the correctness of the matcher is
not harmed by this, but its performance degrades to that of a linear
scan: the skip-table, being filled from an empty pattern, will be
all-zeros, sending bm_find() into the 'possible match' case at every
character.

Since matching is still correct, but slow, it's not possible to write
a test for this. I did, however, leave my attempts in the auto-test,
for when we add QStringView overloads of setPattern() which will then
be able to expose the bug.

Change-Id: I7b803e8624b0352a0a974900affbbfc0c260d93b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-07 16:31:00 +00:00
Aleksey Lysenko
f53ab9d736 Reset QFileDevicePrivate::cachedSize on file close
When a QFile object is reused, the atEnd() method may return incorrect
values. The reason for this is that QFileDevicePrivate::cachedSize is
not cleared. Setting cachedSize = 0 in the close() method fixes this issue.

Task-number: QTBUG-57698
Change-Id: I828a2cf844e98d581098f2c781fa47d2cd3275ce
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-06 07:36:24 +00:00
Thiago Macieira
239418a947 Use a precise timer in tst_QTimer::remainingTime
At 200 ms, the error on first firing could be 10 ms.

Task-number: QTBUG-58519
Change-Id: Ifaee7464122d402991b6fffd14a02a4ce782f11f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-02-05 18:19:51 +00:00
Thierry Bastian
b8dbde10a0 Fix data corruption when reading byte arrays from QSettings
On macOS, the code that read the plist is using
QByteArray::fromRawCFData. When we return the data directly
we need to detach the QByteArray so that it does not point
CFData's data that will get deallocated just after the call.

Task-number: QTBUG-58531
Change-Id: If829a304b986c99c8fc2aeeb992f2d539a4eef3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-02-03 15:37:58 +00:00
David Faure
61371f0321 tst_qurl: add test for fromUserInput(3 args) using "." as working dir
As used in recent qtdeclarative commits, so better make sure it keeps working.

Change-Id: I6d0ceda76201e3e7f75661cb6449e1ff32329126
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-02 12:12:58 +00:00
Thiago Macieira
14f0964344 QVariant: don't do fuzzy comparisons with NaN and infinities
There was a test that tested this, but was wrong.

[ChangeLog][QtCore][QVariant] Fixed a bug that caused wrong results for
comparisons of QVariants containing either NaN or infinite numbers.

Task-number: QTBUG-56073
Change-Id: I33dc971f005a4848bb8ffffd1475d29d00dd1b7f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-31 19:09:28 +00:00
Thiago Macieira
e2c0d1ea2e Read the .ini file back in text mode
Because on Windows, the .ini files are saved with CRLF, but the files in
the Qt resource are just LF (.gitattributes makes them so).

Task-number: QTBUG-25446
Change-Id: I5eab0d9620bd1ba675b0a87c554f62cef0f98fcc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-31 06:03:39 +00:00
Allan Sandfeld Jensen
f823af43f2 QVariant of nullptr should always be null
Implements isNull for QVariants of a nullptr so they always return
true to isNull(), instead of depending on how they were constructed.

Task-number: QTBUG-58296
Change-Id: Ibddec795cdadedef7e17d22c265c29e752d8f99f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-25 17:05:18 +00:00
Allan Sandfeld Jensen
374a173d14 Improve QTest::qWait() precision and switch to QDeadlineTimer
Do not wait up to the timeout ms after already having waited several
times. At the same time upgrade to using the QDeadlineTimer which
is designed for this purpose.

Change-Id: Iaf5e4f4655605d5143ce91040c6eb6706752e504
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-25 16:40:57 +00:00
Friedemann Kleint
a8a74fe81a Stabilize tst_QPropertyAnimation::noStartValue()
Remove the qWait() and introduce a QTRY_COMPARE()
checking for the end value first.

Task-number: QTBUG-58402
Change-Id: I2d3758178de5f67881008f28c406076ad27c4a90
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-01-25 11:36:41 +00:00
Friedemann Kleint
578154c47d tst_QPauseAnimation: Use QTRY_COMPARE for checking the stopped state
Use QTRY_COMPARE with a timeout to check for the stopped state
unless BAD_TIMER_RESOLUTION is defined.
This speeds up the test by 1s and prints diagnostic information
should an interval be too short (as seems to be the case on macOS,
currently).

Change-Id: I8f884cd66ad33314124d3130d9f49606e6dfe9f3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-01-20 18:03:34 +00:00
Thiago Macieira
5a1b4832a2 Adapt to the C++ SIC introduced by P0021: noexcept overloading
C++17 adopts P0021R1[1], which makes noexcept be part of the function
pointer's type and thus be overloadable. It contains some provisions for
allowing a noexcept function pointer to cast implicitly to a non-
noexcept function pointer, but that fails in the presence of templates
and additional overloads that could match the type in question.

Fortunately, the paper proposed a test macro, so we can change our
sources now and be compatible with both C++14 and C++17 rules.

This first failed with Clang 4.0 trunk. This source incompatibility is
not our fault, it's the language's doing.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html

Task-number: QTBUG-58054
Change-Id: I2bc52f3c7a574209b213fffd14988cf0b875be63
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-14 03:24:30 +00:00
Marc Mutz
f480196f1b tst_utf8: remove duplicate nonCharacters() data
The population of data rows was factored into a separate file, qutf8data.cpp, in
commit e20c4730. Merge commit 9bd03235 failed to track a conflicting change into
the new file, and brought the code back into the tst_utf8.cpp, where it has been
duplicating the utf8data data ever since.

Change-Id: I4282685b882448f927289468bd7ab340a21ea0b3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-10 18:39:31 +00:00
Jason Erb
ae42bf0f9b Fixed Chinese language selection on iOS
For language "Traditional Chinese" on iOS with region "US",
the logic was formerly to attempt a match on country/language/script (fail),
followed by country/language (which would result in script defaulting to
"Simplified"). Now, the logic is to try language/script first if script is
specified. Failing that, language/country will be attempted.

Task-number: QTBUG-39639
Change-Id: I75a774b1e66686e95167ff221458a97a7ea2660d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jason Erb <jason.erb@sparist.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-10 17:35:35 +00:00
Ulf Hermann
0979c5304c Drop unnecessary dependencies from some tests
The future tests don't need QtConcurrent as QFuture and friends are in
QtCore. The printdevice test doesn't use QtNetwork and the lancelot as
well as the testlib tests don't use QtXml.

Change-Id: I150ac99b36682aa23ad22ba943266eb0f0952838
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-10 16:34:52 +00:00
Ulf Hermann
2ed9a52ebf Fix compilation without sharedmemory
We have to enable qt_safe_ftok with either sharedmemory or
systemsemaphore. In order to make the resulting QT_CONFIG work with the
bootstrap library we switch the features off for bootstrapping. Some
tests and examples have to be excluded when sharedmemory is not
available.

Change-Id: I3fc3926d160202b378be2293fba40201a4bf50c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-05 08:38:33 +00:00
Stephen Kelly
baad82d242 QIPM: Persist model indexes after emitting layoutChange, not before
Callers can persist a QModelIndex which was not persisted before in a
slot connected to the signal, and such a persisted index must be updated
in the course of the layoutChange.

Store the indexes to persist after emitting the signal.

Task-number: QTBUG-32981
Change-Id: Ibee4c0d84817d72603a03fe5b22fdeefeac0695e
Reviewed-by: David Faure <david.faure@kdab.com>
2016-12-21 01:37:50 +00:00
Stephen Kelly
0874861bcc QSFPM: Remove data manipulation from move handlers
Similar to the fix in the parent commit, incorrect updating of the
internal data structures during layout changes can lead to dangling
pointers being dereferenced later.  Moves are treated as layoutChanges
by this proxy by forwarding to the appropriate method.  However, data is
incorrectly cleared prior to that forwarding.  Remove that, and let the
layoutChange handling take appropriate action.

Change-Id: Iee951e37152328a4e6a5fb8e5385c32a2fe4c0bd
Reviewed-by: David Faure <david.faure@kdab.com>
2016-12-21 01:37:40 +00:00
Stephen Kelly
3bd0fd8f97 QSFPM: Fix handling of source model layout change
In sourceLayoutAboutToBeChanged the source model update is ignored if
the affected parents are filtered out anyway.  The same logic is
attempted in the sourceLayoutChanged slot, but there the early-return
logic is applied too late - the mapping is cleared before performing the
early-return.  Because pointers into the mapping are used in the
internalPointer of QModelIndexes in this class, persistent indexes used
later will segfault when attempting to dereference it.

Additionally, if a parent becomes invalid as a result of the
layoutChange, it would be filtered out by the condition in the loop,
resulting in a different result in the comparison of emptiness of the
parents container.

Fix that by persisting the parent's container, and performing the test
for early-return before clearing the mapping.

Task-number: QTBUG-47711
Task-number: QTBUG-32981
Change-Id: If45e8a1c97d39454160f52041bc9ae7e337dce97
Reviewed-by: David Faure <david.faure@kdab.com>
2016-12-21 01:37:31 +00:00
Friedemann Kleint
101449a4cf QDir::cd(): Handle UNC server paths correctly
Add a bool *ok out parameter to qt_normalizePathSegments() and return false
when ".." are left over for an absolute path, indicating an attempt to
change above root.
Factor out static helper qt_cleanPath() to be able to pass the return value
to QDir::cd() and return on failure from there.

Amends change 63f634322b, which did
not handle UNC paths.

Task-number: QTBUG-53712
Change-Id: I3e63a5dd0259306a0b99145348d815899582f78e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 07:25:22 +00:00
Friedemann Kleint
f7b44f879c QDir::cleanPath(): Do not cd above root paths (UNC, WinRT)
Calling QDir::cleanPath() on "//server/path/.." resulted in "/".

Factor out a function to determine the root path part of an absolute
path for later use, and handle some special cases:
- Consider server name of "//server/path/.." as part of the prefix.
- Check on the root path for WinRT.

Task-number: QTBUG-53712
Change-Id: Ibddacf06212b6fc86fa74a5e4078df6cfd5b66f5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 07:25:05 +00:00
Friedemann Kleint
0a2759e8f8 tst_QTextStream: Use casts instead of Q_UINT64_C for negative values cast to quint64
Q_UINT64_C appends a literal, which causes warnings:
tst_qtextstream.cpp(2026): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2030): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2031): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2032): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2289): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2309): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2329): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2355): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2381): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2411): warning C4146: unary minus operator applied to unsigned type, result still unsigned

Change-Id: I69ac87c224b75aff059477362d8a317c7e766ec2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-11-30 10:48:50 +00:00
Friedemann Kleint
1e303601a7 Fix warnings in tests (MinGW/MSCV)
tst_qtcpsocket.cpp:606:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
tst_qtcpsocket.cpp:670:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
tst_qfile.cpp(2661): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
tst_qarraydata.cpp(760): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
main.cpp:40:33: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]

Change-Id: I80ccef29b71af6a2c3d45a79aedaeb37f49bba72
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-11-29 17:08:46 +00:00
Friedemann Kleint
6aa2d49d5f tst_qchar: Silence deprecation warning
Change-Id: I248d815862a4172ceae6ba45391cba0a30b8e1ae
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-29 16:20:01 +00:00
Friedemann Kleint
33c50e910c Fix tst_QString::sprintf()
Compare to QLatin1String and use reinterpret_cast to fix MSVC warning:
tst_qstring.cpp(1271): warning C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size

Change-Id: I4f26d72f0fad59e09636fe609a2772309a688e5c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-29 14:10:08 +00:00
Friedemann Kleint
49cdf51ac9 Fix some warnings in tests
../tst_qfile.cpp: In member function 'void tst_QFile::handle()':
../tst_qfile.cpp:2661:38: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
tst_qstatictext.cpp:862:58: warning: unused parameter 'textItem' [-Wunused-parameter]
../tst_qtcpsocket.cpp: In member function 'void tst_QTcpSocket::abortiveClose()':
../tst_qtcpsocket.cpp:2254:90: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
Test.cpp: In member function 'void My4Socket::read()':
Test.cpp:66:20: warning: 'reply' may be used uninitialized in this function [-Wmaybe-uninitialized]
../tst_qlocalsocket.cpp: In lambda function:
../tst_qlocalsocket.cpp:701:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../tst_qtcpserver.cpp: In member function 'void tst_QTcpServer::linkLocal()':
../tst_qtcpserver.cpp:935:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
../tst_qtcpserver.cpp:940:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Change-Id: Ic315069768bcb63a6b333c28ac65b0b992b0d43f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2016-11-28 13:10:43 +00:00
Liang Qi
4783de0473 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/network/socket/qnativesocketengine_winrt.cpp
	tools/configure/configureapp.cpp
	tools/configure/environment.cpp

Change-Id: Ieae6f2ee004a87f041751852b687484f91ee4480
2016-11-24 10:31:21 +01:00
Edward Welbourne
a32424b46c AreArgumentsNarrowedBase: Correct logic for narrowing connect() casts
The prior test deemed there to be narrowing if source and destination
integral-or-enum types didn't have the same signedness; but all values
of an unsigned source type can be represented in a larger signed
destination type, so there is no narrowing in this case.
Updated QObject test-case to match.

Change-Id: I517a5997adcad70e185d7469a8d26788e463cb75
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-11-23 09:24:40 +00:00
Liang Qi
38c1057f69 Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 0d2f0164f4.

Conflicts:
	header.BSD-NEW
	qmake/Makefile.win32
	src/openglextensions/qopenglextensions.cpp
	src/openglextensions/qopenglextensions.h
	src/winmain/qtmain_win.cpp
	src/winmain/qtmain_winrt.cpp
	tools/configure/configureapp.cpp
	util/glgen/qopenglextensions.cpp.header
	util/glgen/qopenglextensions.h.header

Change-Id: If26c6f4111b342378dd88bbdc657e322d2ab6ad8
2016-11-23 09:24:36 +01:00
Marc Mutz
d6c8fab880 QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as

   mutex.try_lock_for(10us)

to compile, which is misleading, since it's actually a zero-
timeout try_lock().

Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.

Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.

In the above example, the try_lock_for call is now equivalent
to

  mutex.tryLock(1);

The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.

Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-22 11:32:35 +00:00
Andy Shaw
3cd457bdad Handle RemovePath correctly when calling matches()
Change-Id: Ied324a537df127e676fad26b42e658a9d5aeec9b
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-22 07:05:30 +00:00
Friedemann Kleint
ad788c1014 tst_qstandardpaths: Disable WOW64 redirection on Windows
The logo (microsoft.windows.softwarelogo.showdesktop.exe) is otherwise
not found.

Change-Id: Ic52329462612a027e2928922a1f9a541dcbc67a3
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-22 05:29:11 +00:00
Simon Hausmann
d207738245 Fix missing last modification time stamp in qrc content
The time stamp is added at the end of the node information and
consequently this also bumps the version.

Task-number: QTBUG-57182
Change-Id: Ia10e006f28c0b168b2bcd74ed8b7098f84d10af3
Reviewed-by: hjk <hjk@qt.io>
2016-11-22 04:57:02 +00:00
Mitch Curtis
f817a995b2 tst_qhooks: test that it's possible to chain multiple hooks together
Chaining hooks together was mentioned by Ossi in the comments of
d953d9a4. This patch justs add a test that verifies that it works, and
also serves as an informal example for developers looking how to do it.

Change-Id: I53a014d5663c289ea0559e0926ed301f4e5110e6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-18 15:22:32 +00:00
Allan Sandfeld Jensen
ac384524c8 Speculative fix for tst_QThread::wait2() flakiness
This test fails on Windows occasionally with values just short of 800, the lowest
observed being 791. It is probably rounding somehow to 10ms segments, so allow
it to be up to 10 ms too fast.

Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-17 14:23:19 +00:00
Liang Qi
90c425642d Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	mkspecs/common/linux-android.conf
	src/gui/opengl/qopengl.h
	src/network/socket/qnativesocketengine_winrt.cpp
	src/network/socket/qnativesocketengine_winrt_p.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
	src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
	sync.profile

Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
2016-11-16 12:35:36 +01:00
Allan Sandfeld Jensen
e133f0cca4 Improve error offset in JSON parsing
Do not consume white-space after a token before the token has been
parsed, otherwise we end up with misleading offsets. This also fixes
a wrong error of illegal number in several cases.

Change-Id: I492ca4de0346a1d0ab73b1c23d7a72dba812664c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-15 14:19:23 +00:00
Liang Qi
9808b53fde Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	configure
	src/plugins/platforms/eglfs/qeglfsintegration.cpp
	src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp

Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
2016-11-15 09:58:16 +01:00
Lars Knoll
bfaa8925d5 Improve the validation algorithm for binary JSON
Add better boundary checks and catch (hopefully all)
cases where invalid binary JSON could cause crashes.

Change-Id: I206510b7c5e3ba953802a5f46645878e65704ecc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-11 12:34:27 +00:00
Kai Koehne
615270a300 Rename QtPrivate::is_[un]signed to QtPrivate::Is[Un]signedEnum
Any other use than for enums should use std::is_[un]signed. Make this
explicit by renaming the type traits.

Change-Id: I494158563c95c710e710d0d337f4e547006df171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-09 09:13:29 +00:00
Kai Koehne
5c3b16706f Remove compiler-specific implementations of Q_IS_ENUM
Since the macro is now just a wrapper for std::is_enum,
its use is also deprecated.

[ChangeLog][QtCore][Global] Q_IS_ENUM is deprecated.
Use std::is_enum<>::value instead.

Change-Id: I09b9f4559c02c81f338cace927873318f2acafde
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-09 09:13:01 +00:00
Kai Koehne
ed7f77071d Replace custom type traits with std one's
Remove most type traits from qtypetraits.h, but keep the custom
implementation of is_signed/is_unsigned. This gets rid of
BSD-3 licensed code from Google in a public header (hugh!).

The custom implementations for is_signed/is_unsigned are kept
because the implementations in gcc's standard headers do not
work as we expect for enums - both is_signed and is_unsigned
always returns false there - see also
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027

[ChangeLog][QtCore][General] Qt now relies on type traits from
the C++ standard library.

Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-08 15:31:17 +00:00
Allan Sandfeld Jensen
baebb6aa26 QVariant to QJsonValue::Null conversion
Adds a few missing parts of the conversion from QVariant to QJsonValue
after the introduction of the nullptr QVariant. The conversion the other
way is already implemented.

Change-Id: I8b25dec4b476c4761c5098a60944ff11c36f8bec
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-08 09:50:32 +00:00
Liang Qi
a732576a66 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	config.tests/win/msvc_version.cpp
	configure.pri
	mkspecs/macx-ios-clang/features/default_post.prf
	mkspecs/macx-ios-clang/features/resolve_config.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/resolve_config.prf
	src/corelib/io/qsettings_mac.cpp
	src/corelib/json/qjsondocument.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.h
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	src/plugins/platforms/ios/qiosintegration.h
	src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
	tests/auto/gui/painting/qpainter/tst_qpainter.cpp
	tools/configure/environment.cpp

Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
2016-11-01 06:02:55 +01:00
Liang Qi
af0d0b9c06 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h
	src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
	src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h
	src/plugins/platforms/ios/qiosintegration.h
	src/widgets/widgets/qcombobox.cpp
	tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
	tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp

Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
2016-10-27 10:23:39 +02:00
Thiago Macieira
6ec86513dd Increase the resolution for QDeadlineTimer unit test
Apparently, the CI can run something over 1000x slower than on my
machine. We're getting over 100 ms delays in operations that shouldn't
have taken more than half a millisecond. The last report was of 136%
over budget, so I multiplied the resolution by 4.

Change-Id: I9093948278414644a416fffd1474406967b2a6ee
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-26 03:16:26 +00:00
Thiago Macieira
047e3f8f04 Autotest: fix silly mistake in assigning where a comparison was intended
The file descriptor has been closed and this test is checking if we get
EBADF.

Change-Id: I33dc971f005a4848bb8ffffd1478eaffd99aa2e9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-10-25 22:55:46 +00:00