summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qfloat16.cpp13
-rw-r--r--src/corelib/global/qfloat16.h4
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qtimer.h4
-rw-r--r--src/corelib/serialization/qjsonwriter.cpp12
-rw-r--r--src/corelib/tools/qsharedpointer.cpp21
-rw-r--r--src/corelib/tools/qt_attribution.json2
7 files changed, 42 insertions, 16 deletions
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 2bf6ff00c2..68763c0606 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -67,6 +67,19 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \macro QT_NO_FLOAT16_OPERATORS
+ \relates <QFloat16>
+ \since 5.12.4
+
+ Defining this macro disables the arithmetic operators for qfloat16.
+
+ This is only necessary on Visual Studio 2017 (and earlier) when including
+ \c {<QFloat16>} and \c{<bitset>} in the same translation unit, which would
+ otherwise cause a compilation error due to a toolchain bug (see
+ [QTBUG-72073]).
+*/
+
+/*!
\fn bool qIsInf(qfloat16 f)
\relates <QFloat16>
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 6f798f8b8f..4d1aa91349 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -106,7 +106,9 @@ private:
Q_CORE_EXPORT static const quint32 shifttable[];
friend bool qIsNull(qfloat16 f) noexcept;
+#if !defined(QT_NO_FLOAT16_OPERATORS)
friend qfloat16 operator-(qfloat16 a) noexcept;
+#endif
};
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
@@ -191,6 +193,7 @@ inline qfloat16::operator float() const noexcept
}
#endif
+#if !defined(QT_NO_FLOAT16_OPERATORS)
inline qfloat16 operator-(qfloat16 a) noexcept
{
qfloat16 f;
@@ -272,6 +275,7 @@ QF16_MAKE_BOOL_OP_INT(!=)
#undef QF16_MAKE_BOOL_OP_INT
QT_WARNING_POP
+#endif // QT_NO_FLOAT16_OPERATORS
/*!
\internal
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 188d529f04..178227e914 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -628,7 +628,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
- \fn template <typename PointerToMemberFunction> QMetaObject::Connection QTimer::callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template <typename MemberFunction> QMetaObject::Connection QTimer::callOnTimeout(const QObject *receiver, MemberFunction *slot, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload callOnTimeout()
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index ae5552f1c9..eb7185c12d 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -100,8 +100,8 @@ public:
QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename Functor>
QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
- template <typename PointerToMemberFunction>
- QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ template <typename MemberFunction>
+ QMetaObject::Connection callOnTimeout(const QObject *receiver, MemberFunction *slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
#else
// singleShot to a QObject slot
template <typename Duration, typename Func1>
diff --git a/src/corelib/serialization/qjsonwriter.cpp b/src/corelib/serialization/qjsonwriter.cpp
index 12ce20ef09..5b246837d2 100644
--- a/src/corelib/serialization/qjsonwriter.cpp
+++ b/src/corelib/serialization/qjsonwriter.cpp
@@ -58,7 +58,6 @@ static inline uchar hexdig(uint u)
static QByteArray escapedString(const QString &s)
{
- const uchar replacement = '?';
QByteArray ba(s.length(), Qt::Uninitialized);
uchar *cursor = reinterpret_cast<uchar *>(const_cast<char *>(ba.constData()));
@@ -111,9 +110,14 @@ static QByteArray escapedString(const QString &s)
} else {
*cursor++ = (uchar)u;
}
- } else {
- if (QUtf8Functions::toUtf8<QUtf8BaseTraits>(u, cursor, src, end) < 0)
- *cursor++ = replacement;
+ } else if (QUtf8Functions::toUtf8<QUtf8BaseTraits>(u, cursor, src, end) < 0) {
+ // failed to get valid utf8 use JSON escape sequence
+ *cursor++ = '\\';
+ *cursor++ = 'u';
+ *cursor++ = hexdig(u>>12 & 0x0f);
+ *cursor++ = hexdig(u>>8 & 0x0f);
+ *cursor++ = hexdig(u>>4 & 0x0f);
+ *cursor++ = hexdig(u & 0x0f);
}
}
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 568d65df6b..ad95176ae1 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -65,14 +65,19 @@
\section1 Thread-Safety
- QSharedPointer and QWeakPointer are thread-safe and operate
- atomically on the pointer value. Different threads can also access
- the QSharedPointer or QWeakPointer pointing to the same object at
- the same time without need for locking mechanisms.
-
- It should be noted that, while the pointer value can be accessed
- in this manner, QSharedPointer and QWeakPointer provide no
- guarantee about the object being pointed to. Thread-safety and
+ QSharedPointer and QWeakPointer are reentrant classes. This means that, in
+ general, a given QSharedPointer or QWeakPointer object \b{cannot} be
+ accessed by multiple threads at the same time without synchronization.
+
+ Different QSharedPointer and QWeakPointer objects can safely be accessed
+ by multiple threads at the same time. This includes the case where they
+ hold pointers to the same object; the reference counting mechanism
+ is atomic, and no manual synchronization is required.
+
+ It should be noted that, while the pointer value can be accessed in this
+ manner (that is, by multiple threads at the same time, without
+ synchronization), QSharedPointer and QWeakPointer provide no guarantee
+ about the object being pointed to. The specific thread-safety and
reentrancy rules for that object still apply.
\section1 Other Pointer Classes
diff --git a/src/corelib/tools/qt_attribution.json b/src/corelib/tools/qt_attribution.json
index a842d9467b..912da3f22c 100644
--- a/src/corelib/tools/qt_attribution.json
+++ b/src/corelib/tools/qt_attribution.json
@@ -29,7 +29,7 @@
world's languages, with the largest and most extensive standard repository of locale data
available.",
"Homepage": "http://cldr.unicode.org/",
- "Version": "v34",
+ "Version": "v35.1",
"License": "// as specified in https://spdx.org/licenses/Unicode-DFS-2016.html",
"License": "Unicode License Agreement - Data Files and Software (2016)",
"LicenseId": "Unicode-DFS-2016",