Commit Graph

2623 Commits

Author SHA1 Message Date
Edward Welbourne
afda26ce5d QDateTime test: clarify overflow-check
An overflow-check needed the datum for the "min" test to be minus the
datum for the "max" test; so explicitly make the former use -max()
instead of synthesising it as min()+1.  This simplifies the
explanation of why that's needed, too.  Clarify the overflow-check's
comment at the same time.

Change-Id: I41f56764fdf5e8c749bfae7a685e5fb77d37b3a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-02 13:13:57 +00:00
Lars Schmertmann
5882866768 Extend qChecksum calculation
ISO 14443-3 is for nfc communication and uses 2 different checksums.
The existing one is from ISO 3309 and the other one is from ITU-V.41.
Both are needed to implement an own transport layer defined in ISO
14443-4 to allow nfc commands with a length above 250 byte independent
from the smartphone.

This change will avoid code duplication in QNearFieldTarget.
The private function qNfcChecksum is a copy of qChecksum.

Change-Id: I790ffec8e2ea46f88b2db6f48b64fdcb140e7b70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-25 08:24:18 +00:00
Andre Hartmann
615027129d QByteArray: Overload toHex() with separator character
The separator character is inserted in the resulting array
after every byte and is useful for MAC address output like
01:23:45🆎cd:ef, Hash fingerprints, or low level data
debug output.

[ChangeLog][QtCore][QByteArray] Added toHex() overload to
insert a separator character between the hex bytes.

Change-Id: Ibe436094badc02f3ade7751aa8b5d690599941d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-24 21:05:43 +00:00
Jake Petroules
b9f56751cb Introduce a configure option for QProcessEnvironment
This decouples QProcess and QProcessEnvironment, since the latter may
actually be available on platforms where the former is not.

Change-Id: I3dc799ffdf94486b64143ed01a369897fff44a96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-16 09:14:24 +00:00
Edward Welbourne
ff4f0c3276 Fix handling of time-zones in QDateTime::toString(Qt::TextDate)
Previously, a zone-based time would claim to be GMT, rather than
identifying its zone properly.  Sadly, testing this reveals that
proprietary operating systems don't handle abbreviations ideally.

Task-number: QTBUG-57320
Task-number: QTBUG-57298
Change-Id: I8d8b7fffdbf65ac6178a65f5fc2df4d25afb1a14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 16:40:57 +00:00
Edward Welbourne
7c33c644d3 Fix QDateTime::toString(Qt::ISODate)'s handling of Qt::TimeZone
When the time is specified relative to a zone, the ISO date produced
lacked its offset suffix; all zones were treated as if they were local
time.  Handle zone as for an offset from UTC and ensure we do set the
date-time objects's offset from UTC when it's zone-based.

Change-Id: I7c9896bb8ec0a9d89df14a6e94b005174ab9e943
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 16:40:42 +00:00
Allan Sandfeld Jensen
b750a3786f Lower timeout on tst_QSemaphore::tryAcquireWithTimeout
The test was so slow it was blacklisted on all platforms for timing out.
This patch lowers the timeout to a 5th and tries removing the blacklist.

Change-Id: Ib28b21de572517c548a14300f26815598efe91e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-14 14:39:58 +00:00
Liang Qi
6755ec891a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	configure
	qmake/Makefile.unix.macos
	qmake/Makefile.unix.win32
	qmake/generators/win32/msvc_vcproj.cpp
	src/3rdparty/pcre/qt_attribution.json
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qdeadlinetimer.cpp
	src/platformsupport/kmsconvenience/qkmsdevice.cpp
	src/platformsupport/kmsconvenience/qkmsdevice_p.h
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
	tests/manual/qstorageinfo/printvolumes.cpp
	tools/configure/configureapp.cpp

Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
2016-12-13 09:39:20 +01:00
Edward Welbourne
3ce6b1e578 tst_QTimeZone::printTimeZone: pass zone by reference
It's a const parameter, so no sense copying it.

Change-Id: I4a673a6a60af9bfe7cb61ce28de2aa295fa1d069
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:59:17 +00:00
Edward Welbourne
aa06ea0d8b tst_QTimeZone: tidy up handling of debug member
Make it const, initialize it instead of assigning, consolidate testing
of it round some #if-ery.

Change-Id: I2efbf58292a0edd2ceb3da8d3cc16246e84a3bac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:58:58 +00:00
Edward Welbourne
6e3f58cbbe QDateTime, QTimeZone: fix mappings from zone time to UTC
Such mappings are ill-defined in the presence of daylight-savings time
(DST); at its transitions, you need information about whether DST is
active or not to determine the correct UTC value.  Existing code did
not have a way to be told that hint, so could not be correct.

Fixing this required changing the (thankfully private) APIs by which
QDateTime accessed QTimeZone's information stipulated by zone time.
In QDateTime, this required propagating the needed hint, when DST
status was known.

QAndroidTimeZonePrivate overloaded QTimeZonePrivate::dataForLocalTime
with an implementation that works whenever !hasTransitions(); the base
implementation handled this case lamely, so I've moved the Android
implementation there, to have only one place for both re-writes.

Amended tst_QDateTime's expected failures; passing a date and time to
the constructor *is* ambiguous when the moment indicated is in a
transition.  I have changed which way we resolve that ambiguity.

Added round-trip test of QDateTime's fromMSecs/toMSecs (but as a
QTimeZone test, since that's what's actually getting tested), based on
a test-case from Marko Kangas.  Initially failed for various zones,
each at one hour-offset; and, on some platforms, for some zones, at
all offsets.  These last revealed that a platform may claim to have
zone information yet, for some zones, lack it (or have very incomplete
information).  In each case, despite this, the platform does give
offsetFromUtc().  (The test also found another pre-existing bug on
Linux; fixed in an earlier commit.)

To accommodate these gaps in transition data, the transition-based
code now falls back to the offsetFromUtc()-based code (used when there
are no transitions) if it can't find a previous transition (which, in
any case, it needs to do its job).

Task-number: QTBUG-56460
Task-number: QTBUG-56397
Task-number: QTBUG-52284
Change-Id: I2f7422a9e9d3767940b1901d887c6a2c1f36ac9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 13:58:26 +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
Giuseppe D'Angelo
e5e26294f2 foreach: do not use operators that trigger non-evaluated contexts
Namely: decltype(). Ideally we'd want C++17's template constructor
argument deduction, but instead use the C++11 solution: a factory
function. This enables using things such as lambdas in the container
argument.

Change-Id: Idba64d8069d15bbafe54cfdebe24b1fba1eb8d0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-10 18:11:38 +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
e5ac4afbf9 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	mkspecs/features/mac/default_post.prf
	mkspecs/features/uikit/default_post.prf

Change-Id: I2a6f783451f2ac9eb4c1a050f605435d2dacf218
2016-11-17 14:43:26 +01: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
d7e4980132 Merge remote-tracking branch 'origin/5.8' into dev
Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS.

Conflicts:
	mkspecs/features/mac/default_post.prf
	mkspecs/features/mac/sdk.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/sdk.prf
	src/angle/src/libEGL/libEGL.pro
	src/platformsupport/fontdatabases/fontdatabases.pro
	src/platformsupport/platformsupport.pro
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	tests/auto/widgets/widgets/qmenubar/BLACKLIST
	tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp

Task-number: QTBUG-56853
Change-Id: If58785210feee3550892fc7768cce90e75a2416c
2016-11-02 09:24:11 +01: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
Erik Verbruggen
f6eb570c7d Darwin: normalize all watched paths to composed from
This will be done by all POSIX APIs for strings coming in that way, but
because other code (like NSWhateverViews) will most likely return
decomposed form, we make sure that those are in composed form too.

Task-number: QTBUG-55896
Change-Id: I065e11cee6b59706d4346ed20d4b59b9b95163b8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-24 15:10:42 +00:00
Tor Arne Vestbø
7437ede145 macOS: Don't build auto-tests as application bundles unless explicitly requested
Consistent with other Unix platforms, and internally consistent between tests,
as a lot of tests were already applying CONFIG -= app_bundle manually.

Change-Id: Icd2b7e1c08015b26137af60ff82fddbc753f0ff4
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-23 10:39:56 +00:00
Liang Qi
28628a5d5e Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/eglfs/qeglfshooks.cpp

Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
2016-10-22 21:19:57 +02:00
Erik Verbruggen
49d3bb0058 Normalize realpath(3) output to composed form
All strings coming out of POSIX API calls are converted to composed form
by QFile::decodeName. Do the same for realpath(3) output. This is
especially important for HFS+, which will store file names in decomposed
form, and APIs will therefore return strings in decomposed form.

Task-number: QTBUG-55896
Change-Id: I5e51f4e5712ff26bf9644cbcf9a9603995748892
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-21 07:49:00 +00:00
Tor Arne Vestbø
837781db52 Add Qt::ISODateWithMs date format, with support in QTime/Date/DateTime
The Qt::ISODate format strips milliseconds, so a new format is introduced
that keeps the milliseconds. A new format was chosen over fixing the
existing format due to the behavioral change of suddenly having ms
as part of Qt::ISODate.

Change-Id: If8b852daed068cce8eee9b61a7cd4576bc763443
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-20 15:15:40 +00:00
Marc Mutz
e80faf3db6 QTimer: don't circumvent <chrono> safety net
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
violate a principal design rule of <chrono>, namely that non-
narrowing conversions are implicit, but narrowing conversions
need duration_cast. By accepting any duration, we allow non-
sensical code such as

   QTimer::singleShot(10us, ...)

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

Overloading a non-template with a template also has adverse
effects: it breaks qOverload().

Fix by replacing the function templates with functions that
just take std::chrono::milliseconds. This way, benign code
such as

    QTimer::singleShot(10s, ...)
    QTimer::singleShot(10min, ...)
    QTimer::singleShot(1h, ...)

work as expected, but attempts to use sub-millisecond
resolution fails to compile / needs an explicit user-
provided duration_cast.

To allow future extension to more precise timers, forcibly
inline the functions, so they don't partake in the ABI of the
class and we can later support sub-millisecond resolution by
simply taking micro- or nano- instead of milliseconds.

Change-Id: I12c9a98bdabefcd8ec18a9eb09f87ad908d889de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 16:06:28 +00:00
Tor Arne Vestbø
4cb614c7ab Apple OS: Handle QSetting strings with embedded zero-bytes
Saving strings with embedded zero-bytes (\0) as CFStrings would
sometimes fail, and only write the part of the string leading
up to the first zero-byte, instead of all the way to the final
zero-terminator. This bug was revealed by the code-path that
falls back to storing e.g. QTime as strings, via the helper
method QSettingsPrivate::variantToString().

We now use the same approach as on platforms such as Windows
and WinRT, where the string produced by variantToString() is
checked for null-bytes, and if so, stored using a binary
representation instead of as a string. For our case that
means we fall back to CFData when detecting the null-byte.

To separate strings from regular byte arrays, new logic has
been added to variantToString() that wraps the null-byte
strings in @String(). That way we can implement a fast-path
when converting back from CFData, that doesn't go via the
slow and lossy conversion via UTF8, and the resulting QVariant
will be of type QVariant::ByteArray. The reason for using
UTF-8 as the binary representation of the string is that
in the case of storing a QByteArray("@foo") we need to
still be able to convert it back to the same byte array,
which doesn't work if the on-disk format is UTF-16.

Task-number: QTBUG-56124
Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8
Cherry-picked: 764f5bf48c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 14:35:08 +00:00
Liang Qi
dfc177e3a9 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	qmake/library/qmakeevaluator.cpp
	(cherry picked from commit 1af6dc2c8fb4d91400fddc5050166f972ae57c9a in qttools)
	src/corelib/kernel/qcore_mac_objc.mm
	src/gui/painting/qcolor.h
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: I5b3ec468a5a9a73911b528d3d24ff8e19f339f31
2016-10-13 09:49:38 +02:00