summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-02-15 21:19:50 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-02-15 21:19:50 +0000
commit1ef03f69e8416a70efd14df09e1231ce0bc00ea9 (patch)
tree7edc868dff999b4f9123bf87e92c9a7cb72e9db1 /src/corelib
parent23eab78f510a9cfb050980f522dc23409e23fbdb (diff)
parentbb0fec8057dd11c359bfcb4aefb66d9b210f52a6 (diff)
Merge "Merge remote-tracking branch 'origin/5.10' into 5.11" into refs/staging/5.11
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/global/qrandom.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp23
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h1
-rw-r--r--src/corelib/tools/qstring.cpp27
6 files changed, 46 insertions, 14 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 2079d2117f..3db2e2ceb8 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -12,7 +12,7 @@ CONFIG += qt_tracepoints
CONFIG += $$MODULE_CONFIG
DEFINES += $$MODULE_DEFINES
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
-win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
+msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x67000000
CONFIG += simd optimize_full
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 6c26d4682d..9143e04d45 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -74,7 +74,7 @@ DECLSPEC_IMPORT BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG Rando
}
#endif
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
# include <private/qjni_p.h>
#endif
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 7dd4f6556d..bc39ea73ee 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -185,10 +185,11 @@ bool QFSFileEnginePrivate::nativeFlush()
bool QFSFileEnginePrivate::nativeSyncToDisk()
{
Q_Q(QFSFileEngine);
+ int ret;
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
- const int ret = fdatasync(nativeHandle());
+ EINTR_LOOP(ret, fdatasync(nativeHandle()));
#else
- const int ret = fsync(nativeHandle());
+ EINTR_LOOP(ret, fsync(nativeHandle()));
#endif
if (ret != 0)
q->setError(QFile::WriteError, qt_error_string(errno));
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index bbd442d570..330870f219 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -905,6 +905,7 @@ bool QEventDispatcherWin32::registerEventNotifier(QWinEventNotifier *notifier)
return true;
d->winEventNotifierList.append(notifier);
+ d->winEventNotifierListModified = true;
if (!d->winEventNotifierActivatedEvent)
d->winEventNotifierActivatedEvent = CreateEvent(0, TRUE, FALSE, nullptr);
@@ -928,6 +929,7 @@ void QEventDispatcherWin32::unregisterEventNotifier(QWinEventNotifier *notifier)
if (i == -1)
return;
d->winEventNotifierList.takeAt(i);
+ d->winEventNotifierListModified = true;
QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
if (nd->waitHandle)
nd->unregisterWaitObject();
@@ -938,16 +940,19 @@ void QEventDispatcherWin32::activateEventNotifiers()
Q_D(QEventDispatcherWin32);
ResetEvent(d->winEventNotifierActivatedEvent);
- // Iterate backwards, because the notifier might remove itself on activate().
- for (int i = d->winEventNotifierList.count(); --i >= 0;) {
- QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
- QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
- if (nd->signaledCount.load() != 0) {
- --nd->signaledCount;
- nd->unregisterWaitObject();
- d->activateEventNotifier(notifier);
+ // Activate signaled notifiers. Our winEventNotifierList can be modified in activation slots.
+ do {
+ d->winEventNotifierListModified = false;
+ for (int i = 0; i < d->winEventNotifierList.count(); ++i) {
+ QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
+ QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
+ if (nd->signaledCount.load() != 0) {
+ --nd->signaledCount;
+ nd->unregisterWaitObject();
+ d->activateEventNotifier(notifier);
+ }
}
- }
+ } while (d->winEventNotifierListModified);
// Re-register the remaining activated notifiers.
for (int i = 0; i < d->winEventNotifierList.count(); ++i) {
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index 683c7f8f36..a7ed8dda8a 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -195,6 +195,7 @@ public:
HANDLE winEventNotifierActivatedEvent;
QList<QWinEventNotifier *> winEventNotifierList;
+ bool winEventNotifierListModified = false;
void activateEventNotifier(QWinEventNotifier * wen);
QList<MSG> queuedUserInputEvents;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 25f829c38c..08fe9b899d 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -6887,6 +6887,8 @@ QString QString::vasprintf(const char *cformat, va_list ap)
\snippet qstring/main.cpp 74
+ This function ignores leading and trailing whitespace.
+
\sa number(), toULongLong(), toInt(), QLocale::toLongLong()
*/
@@ -6927,6 +6929,8 @@ qlonglong QString::toIntegral_helper(const QChar *data, int len, bool *ok, int b
\snippet qstring/main.cpp 79
+ This function ignores leading and trailing whitespace.
+
\sa number(), toLongLong(), QLocale::toULongLong()
*/
@@ -6969,6 +6973,8 @@ qulonglong QString::toIntegral_helper(const QChar *data, uint len, bool *ok, int
\snippet qstring/main.cpp 73
+ This function ignores leading and trailing whitespace.
+
\sa number(), toULong(), toInt(), QLocale::toInt()
*/
@@ -6998,6 +7004,8 @@ long QString::toLong(bool *ok, int base) const
\snippet qstring/main.cpp 78
+ This function ignores leading and trailing whitespace.
+
\sa number(), QLocale::toUInt()
*/
@@ -7026,6 +7034,8 @@ ulong QString::toULong(bool *ok, int base) const
\snippet qstring/main.cpp 72
+ This function ignores leading and trailing whitespace.
+
\sa number(), toUInt(), toDouble(), QLocale::toInt()
*/
@@ -7053,6 +7063,8 @@ int QString::toInt(bool *ok, int base) const
\snippet qstring/main.cpp 77
+ This function ignores leading and trailing whitespace.
+
\sa number(), toInt(), QLocale::toUInt()
*/
@@ -7080,6 +7092,8 @@ uint QString::toUInt(bool *ok, int base) const
\snippet qstring/main.cpp 76
+ This function ignores leading and trailing whitespace.
+
\sa number(), toUShort(), toInt(), QLocale::toShort()
*/
@@ -7107,6 +7121,8 @@ short QString::toShort(bool *ok, int base) const
\snippet qstring/main.cpp 80
+ This function ignores leading and trailing whitespace.
+
\sa number(), toShort(), QLocale::toUShort()
*/
@@ -7126,7 +7142,10 @@ ushort QString::toUShort(bool *ok, int base) const
\snippet qstring/main.cpp 66
- \warning The QString content may only contain valid numerical characters which includes the plus/minus sign, the characters g and e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error.
+ \warning The QString content may only contain valid numerical characters
+ which includes the plus/minus sign, the characters g and e used in scientific
+ notation, and the decimal point. Including the unit or additional characters
+ leads to a conversion error.
\snippet qstring/main.cpp 67
@@ -7141,6 +7160,8 @@ ushort QString::toUShort(bool *ok, int base) const
\snippet qstring/main.cpp 69
+ This function ignores leading and trailing whitespace.
+
\sa number(), QLocale::setDefault(), QLocale::toDouble(), trimmed()
*/
@@ -7155,6 +7176,8 @@ double QString::toDouble(bool *ok) const
If a conversion error occurs, *\a{ok} is set to \c false; otherwise
*\a{ok} is set to \c true. Returns 0.0 if the conversion fails.
+ This function ignores leading and trailing whitespace.
+
The string conversion will always happen in the 'C' locale. For locale
dependent conversion use QLocale::toFloat()
@@ -7162,6 +7185,8 @@ double QString::toDouble(bool *ok) const
\snippet qstring/main.cpp 71
+ This function ignores leading and trailing whitespace.
+
\sa number(), toDouble(), toInt(), QLocale::toFloat()
*/