Commit Graph

6566 Commits

Author SHA1 Message Date
Liang Qi
d90b155c60 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/macx-ios-clang/features/resolve_config.prf
	src/testlib/qtestcase.qdoc

Change-Id: Icefa63056ffb37106f35299a8f19165535571799
2016-10-17 11:02:54 +02:00
J-P Nurmi
7740f5e98b QMimeXMLProvider: add missing out-of-line destructor
Fixes build with the latest GCC 7.

Change-Id: I4900a256ed1c6cb177d7f94d54e5b07c06ddad08
Task-number: QTBUG-56514
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-13 16:54:30 +00:00
Kai Koehne
d023b300b2 Document that am/pm in QDateTime::toString are locale-specific
Change-Id: I28382b25ac94cbfbad4acff1308ddd8baf5ca693
Task-number: QTBUG-55632
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-13 15:16:23 +00:00
Liang Qi
3e71810cf3 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/network/access/qhttpnetworkconnection.cpp
	src/network/access/qhttpnetworkconnection_p.h

Change-Id: I11f8641ef482efa8cee1b79977d19cc3182814b4
2016-10-08 17:15:55 +02:00
Erik Verbruggen
eda095ebb4 Darwin: correct state restore when FSEventsStream starting fails
The previous state was not restored completely when adding/removing
paths resulted in a stream start failure.

It also removes an autoreleasepool in restartStream, because both
stopStream and startStream do already create an autoreleasepool of their
own. (So, this pool will always be empty.)

Change-Id: Idc674e9c040f346703ab3ec256957e787a0ade73
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-07 09:13:34 +00:00
Sune Vuorela
4268dde1f1 QTemporaryFile's setFileTemplate operates not only on XXXXXX in the end
Is even covered by unit tests.

Change-Id: I7b22da2a338868fdb99c6238925f944bfea88190
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-06 21:33:29 +00:00
Kai Koehne
8f4054a7e6 Doc: Document that by default, QTimer is not single-shot
Change-Id: I586997ddb5ed55d68f53ddfe9302b961296cc4eb
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-10-06 13:51:48 +00:00
Liang Qi
6feec9da93 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I34b5e290233d0869fbafac094a939aec2bf83fd5
2016-10-05 19:33:26 +02:00
Frederik Schwarzer
c3605980d9 Fix some typos and minor sentence structure issues in docs
Change-Id: Ibede1aeb046e2df6723e3041152bfae22a9fde32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-05 15:00:24 +00:00
Maurice Kalinowski
d44925507b winrt: Fix compilation for projects using C++/CX extensions
In case a project uses C++/CX extensions via /ZW compile flag including
qfunctions_winrt.h resulted in a compile error about duplicate
definition of Started due to namespace usages.

Change-Id: I8913522eafbabae77dd7d17187f202e555b0275f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-10-05 06:33:33 +00:00
Peter Varga
37ad51a44e Revert "Doc: Added enums in qnamespace.qdoc"
Remove duplicated enum values from doc.

This reverts commit dfb55da5d6.

Change-Id: I27c85f66123731e0106bd702e843a24d7e9b5931
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-10-04 17:58:57 +00:00
Alex Trotsenko
4518345b80 QIODevice: add CHECK_MAXBYTEARRAYSIZE macro
It unifies handling of QByteArray's size limit in read(), readLine()
and will be used in a follow-up change which optimizes the performance
of QIODevice::peek() function.

Change-Id: Idb9fbbe14d9632ee267d2a0e47c8a88603c024a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-01 17:36:50 +00:00
Liang Qi
680dd3313c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/global/qlogging.cpp

Change-Id: I9cc8f25ad897efab6a42cb5c5161b1c9402952f0
2016-09-23 22:28:33 +02:00
Olivier Goffart
7c5cf8b2bd Fix bootstrap applications crashing when QT_MESSAGE_PATTERN contains %{backtrace}
tokens[i] was left uninitialized. This could cause a crash when moc produces a
qWarning.

Task-number: QTBUG-56045
Change-Id: I6fba933005edd29756f0d6b1cfe53243254ac7b2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-21 13:22:54 +00:00
Liang Qi
d10e4c193b Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I9cfefaf22b010fca937be77979f5fb50574bb71e
2016-09-21 07:14:40 +02:00
Samuel Gaist
23e76a12b9 Doc: add macOS example of QAbstractNativeEventFilter implementation
This patch adds a sample native event filter that can be easily
integrated in a project.

Task-number: QTBUG-53209
Change-Id: Iedf6df33a3de5b01dc7871cca5e7897a5b485733
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-09-20 21:23:32 +00:00
Frederik Schwarzer
e30d0e462f QAbstractProxyModel: fix sentence structure in apidoc
Change-Id: Ib3371549ecb80da326260b1df431f20e7a04f07e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-09-19 11:17:58 +00:00
Liang Qi
bd4d847903 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-09-17 03:11:41 +00:00
Liang Qi
d148019f16 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp

Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
2016-09-16 23:16:25 +02:00
Thiago Macieira
597d625c2c Disable forcing of -fomit-frame-pointer with ICC
qlogging.cpp(1226): error #3175: unrecognized gcc optimization level
  __attribute__((optimize("omit-frame-pointer")))
                          ^

Change-Id: I33dc971f005a4848bb8ffffd14748b100dcefa95
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-16 20:50:05 +00:00
Edward Welbourne
a95d81e786 Q(Date|Time)+::(to|from)String(): mention relevant QLocale methods
The const QString &format variants of these methods lack adequate
control over the locale used; the Qt::DateFormat variants give only
limited control over the format string.  So reference the QLocale
methods that provide the general case, in the docs of each.  Also made
the \sa cross-referencing among these methods a little more coherent.

Task-number: QTBUG-55632
Change-Id: Icd0c8548045e74879e941ba089c3bdea78f14e34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 12:07:05 +00:00
Loïc Molinari
2ccf6c60d9 Fix the GCC version supporting -Wsuggest-override
Q_CC_GNU is (__GNUC__ * 100 + __GNUC_MINOR__), so 510 is 5.10 not
5.1.0. The first GCC 5 release has support for -Wsuggest-override, so
it should really be 501.

Change-Id: I7b264af087cd4562ce8720c99b70116d7654ea5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 04:11:57 +00:00
Thiago Macieira
c59c759fcc Suppress ICC warning #111 about unreachable code in toWCharArray
qstring.h(961): warning #111: statement is unreachable

Change-Id: I33dc971f005a4848bb8ffffd14748ae03dadefc9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-15 16:54:56 +00:00
Marc Mutz
a54d44298f QLatin1String: Fix UB (nullptr passed) in relational operators
Found by UBSan:

  qstring.h:1160:44: runtime error: null pointer passed as argument 1, which is declared to never be null
  qstring.h:1160:44: runtime error: null pointer passed as argument 2, which is declared to never be null

Fix by avoiding the memcmp() calls if there's a chance that they
might be called with nullptr.

While at it, also implement !=, >, <=, >= in terms of ==, <,
and add a test, because this particular UB was not fingered by
any of the QtCore test cases, but by a Qt3D one.

Change-Id: I413792dcc8431ef14f0c79f26e89a3e9fab69465
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-09-15 10:10:28 +00:00
Liang Qi
657c2bfbec Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	tests/auto/testlib/selftests/generate_expected_output.py

Change-Id: If856162abf9a24ae2c9946d336a7d1da03520fa7
2016-09-05 13:57:12 +02:00
Marc Mutz
2a6bea7a55 qcompilerdetection.h: retract Q_COMPILER_DEFAULT_MEMBERS for MSVC < 2015
Earlier versions of the compiler cannot default
move special member functions, even though we
also define Q_COMPILER_RVALUE_REFS for them.

Fix by retracting the less-often-used of the
two compiler feature defines.

Q_COMPILER_DEFAULT_MEMBERS is not used outside
QtBase in neither 5.6 nor 5.7 (5.8 is not
released at this time, so wasn't considered).
The same is true of the dependent macros
Q_COMPILER_DEFAULT_DELETE_MEMBERS and
Q_DECL_EQ_DEFAULT.

In QtBase, the three uses are:
1. in QAtomic*, where the user also requires
   Q_COMPILER_CONSTEXPR, which is not defined
   for any MSVC at this time,
2. for QEnableSharedFromThis, which is a class
   template with an alternative {} implementa-
   tion of the default constructor, and uncon-
   ditional user-defined copy special member
   functions.
3. The test of the corresponding functionality
   in tst_compiler, which this commit amends.

That means that neither of these two only uses
of the macro in Qt libraries are affected by
the change.

The reason we do this change, then, is that in
the future, we want to be able to more easily
restore move special member functions for
classes for which they are suppressed due to
user-defined dtors or copy special member
functions.

Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-03 05:11:40 +00:00
Marc Mutz
312d08b290 qstrncpy: don't call strncpy_s with invalid parameters
According to https://msdn.microsoft.com/en-us/library/5dae5d43.aspx,
strncpy_s' second argument must not be 0:

> If strDest or strSource is NULL, *or numberOfElements is 0*, the
> invalid parameter handler is invoked.

Move the existing check for len > 0 up to protect the strncpy_s
call, too.

Change-Id: I70d339ea60d4b76f3038b2e4e4756f6590a9bd31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-03 05:07:54 +00:00
Nico Vertriest
6cbd982836 Revert "Doc: removed reference to non-existing method"
This reverts commit 53f0b43a4b.
{QAbstractAnimation::}{updateCurrentValue()} had been modified to
{QVariantAnimation::}{updateCurrentValue()} in a previous patch.

Change-Id: Ibaccf51de816966f16b8f3109e0c20626d5102a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-26 11:40:11 +00:00
Marc Mutz
d875a04174 QtJson: simplify/add missing relational operators involving Latin1String
As noted by Mat Sutcliffe <oktal3700@gmail.com>, there were
no relational operators for Latin1String/QLatin1String and
String/QLatin1String mixed comparisons, leading to implicit
conversions from QL1S to QString in Entry::op==(QL1S).

This patch fixes half of the issue, by providing the operators
for Latin1String/QLatin1String. In doing so, it cleans up their
definition (non-members, non-friends, delegating to existing
QL1S operators where possible, passing both {Q,}Latin1String by
value, as they're both Trivially Copyable and small).

A follow-up patch will deal with String/QLatin1String
comparisons. It will be not quite as straight-forward as
this patch, since we don't, yet, have QStringView, the
UTF-16 equivalent of QL1S, available.

Amends a5159cc50a.

Change-Id: I596358eb3ccf847b7680f171f9992f3fad80132c
Reviewed-by: Mat Sutcliffe <oktal3700@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-26 08:25:31 +00:00
Liang Qi
13680ceb9a Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-08-25 16:08:09 +00:00
Liang Qi
c7cdf3aac7 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/mimetypes/qmimeprovider.cpp
	src/corelib/mimetypes/qmimetype.cpp

Change-Id: Ib483ddb6bfc380e7c8f195feca535703814c3872
2016-08-25 16:12:11 +02:00
Ulf Hermann
de7f281d7a QLocale: Fix wrong assert
The endptr from reading the exponent of a 'g' form snprintf result
should not be past the end of the string we're reading from. It has
nothing to do with the 'e' sign.

Task-number: QTBUG-54482
Change-Id: I8bdee917b8d21fdc94c255548ad7e008431a07fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-25 12:45:50 +00:00
David Faure
3e453abc7d QMimeType: use default locale rather than system locale
This makes it possible for the application to control which language
is used by QMimeType::comment()

[ChangeLog][QtCore][QMimeType] QMimeType::comment() now uses the default locale
rather than system locale, so that applications can control which language
is being used.

Task-number: QTBUG-50776
Change-Id: I82623b7c488035a4164fadaf37ebcc79a9fd6173
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-24 20:30:13 +00:00
Raphael Kubo da Costa
680ec54a76 QMutex: Make freelist() return a real global static
Since Qt 5.6.0, some applications such as Kate (built with clang, libc++
and libcxxrt) on FreeBSD occasionally crash with the following error
message on exit:

    QMutex::lock(): sem_wait failure: Invalid argument
    [or pthread_cond_wait in the 5.6 branch]

Investigation by Gleb Popov, Thiago Macieira and Olivier Goffart has
shown that this is caused by the fact that QDBusConnectionManager is a
Q_GLOBAL_STATIC (so it will be destroyed with all the other
Q_GLOBAL_STATICs in the reverse order of construction). In the
Q_COMPILER_THREADSAFE_STATICS case, freelist() also returns a
function-level static that is constructed on first use, so it may be
destroyed earlier than the QDBusConnectionManager object, making it
impossible to lock a contended mutex.

We now make freelist() return a global static, so that it is always
destroyed after QDBusConnectionManager and other function-static
variables.

Change-Id: I210fa7c18dbdf2345863da49141b9a85cffdef52
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-23 15:37:00 +00:00
Christian Strømme
5e3f770ad5 Fix problem with exception reporting in QFuture::waitForResult()
This fixes a problem that occurs when a task, that is run synchronously,
throws an exception. If that happened, then the exception would not be
re-thrown, because of an early return.

Task-number: QTBUG-54831
Change-Id: Ic70c5b810ec6adce6e62bfd6832ba9f170b13a7f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-08-23 14:55:49 +00:00
Orgad Shaneh
449390c3a5 Revert "QLocale: Actually get the language script for the system locale"
The text direction should *not* be set by the default script, but by the
UI direction.

For example, if the default script is Hebrew, but the UI is in English,
it doesn't make sense to default all the controls to RTL. This should be
done only if the UI is RTL.

This reverts commit a90869861c.

Task-number: QTBUG-53110
Change-Id: I5a6951ac30f24eec86bc0ae2a9fcfe14eb3a8e28
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-23 14:52:31 +00:00
Venugopal Shivashankar
ca979a2f69 Doc: Remove references to Windows CE in Qt Core
The platform is not supported since Qt 5.7

Task-number: QTBUG-55331
Change-Id: I98b90d574d9a76c4281852d93818620b5f489117
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-23 11:06:30 +00:00
Alexander Volkov
4f6f0cd4c9 Bypass a bug in gcc 4.7 for QAtomicTraits::isLockFree()
It's not possible to build Qt with gcc 4.7 since
aca0e367be because of the bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53473 that doesn't
allow to specialize static members declared both as constexpr
and noexcept. That commit was made after 5.7.0 and it introduced
QAtomicTraits::isLockFree() with these specifiers.

Remove the noexcept specifier to fix building.

Change-Id: Ifc2462c90de1180f1e015fdc0646f246d33e68b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-23 10:10:38 +00:00
Venugopal Shivashankar
c3bd28de8d Doc: Remove references to Windows CE in Qt SQL and Qt Namespace
The platform is not supported since Qt 5.7.

- Removed Windows CE-specific \notes in SQL drivers' documentation
- Marked a couple of Windows CE-specific enum values using
  \omitvalue

Task-number: QTBUG-55331
Change-Id: I35b44f9d31fde6f10013c043260db1b852c171e2
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-08-23 08:28:23 +00:00
Nico Vertriest
53f0b43a4b Doc: removed reference to non-existing method
QAbstractAnimation::updateCurrentValue


Change-Id: I1610591ec43d019ca136df5a01350dc6ca7392ff
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-08-22 14:20:15 +00:00
Marc Mutz
519b8d1a28 QtJson: mark String/Latin1String ctors explicit
An implicit conversion from const char* would be quite unfortunate.
Luckily, the code compiles as-is.

Change-Id: I445f983a27cc25bfaf4285c1a6c5811bd5d201b3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-22 07:43:20 +00:00
Liang Qi
0ca4fcbc36 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/xcb/qxcbintegration.cpp

Change-Id: I2d71d06a55f730df19ace0dd3304238584a0497f
2016-08-18 11:07:51 +02:00
Dyami Caliri
ecb73a7bb3 QJsonValue: use Q_NULLPTR instead of 0 in ctor
Use Q_NULLPTR in all public headers

Task-number: QTBUG-45291
Change-Id: Ib294deb3c210a9a186448cbf9656af7a09fea2c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-17 19:54:40 +00:00
Friedemann Kleint
ff68be114e Fix documentation of the Windows parts of QSettings::setPath()
Explain in terms of CSIDL_ values and update the sample locations.

Task-number: QTBUG-55065
Change-Id: I15ddf32555d43cffae66d98c6ac12d62a98d5e6d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-16 13:51:16 +00:00
Marc Mutz
6d95497931 QLinkedList: compile with -Wzero-as-null-pointer-constant
The existing header check unfortunately doesn't detect uses of
'0' as nullptr in template code.

Task-number: QTBUG-45291
Change-Id: Ibe701402d95deca98c5286e2cee5f7118fd7f606
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-16 13:36:15 +00:00
Liang Qi
6b8f422c5e Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/global/qglobal.cpp
	src/corelib/io/qsettings.cpp
	src/corelib/itemmodels/qstringlistmodel.cpp
	tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp

Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
2016-08-13 01:05:02 +02:00
Frederik Schwarzer
b6fb349ad5 Fix typo (word repetition) in documentation
Change-Id: I1c8785e39f28f94846126fc45b875e6425a4ce12
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-12 10:41:53 +00:00
Topi Reinio
a2ae631c04 Doc: Change instances of '(Mac) OS X' to 'macOS'
As of version 10.12 (Sierra), the name of Apple's desktop operating
system will be macOS. Change the occurrences where the Mac platform
is discussed to use a macro \macos, which expands to 'macOS'. This
helps with adapting to future renaming.

Update the instructions on mac-specific Q_OS_* macro usage.

Add a \target for the old 'Qt for OS X' topic to keep links working
for other documentation modules that try to link with the old name.

Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-08-12 08:30:29 +00:00
Marc Mutz
b57f743c46 QStringListModel: fix dataChanged's roles parameter
In QStringListModel, the display and the edit roles are synonyms,
so when one is changed, the other changes with it. However, in
setData() we only emitted a vector with just the role that was
passed in by the user.

Fix by always passing both roles, regardless of which one was used
to set the data.

Change-Id: I498e7cb33796fae266901817b01ad85d861d4bb4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-12 08:27:53 +00:00
David Faure
4e24ff2e68 QCommandLineParser: call qCoreApp post routines before ::exit()
This gives a chance for some cleanups at least.

Change-Id: I3a628e32c6fc8c7fa00943769210c517005f2a0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-12 08:26:59 +00:00