summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2015-01-21 11:14:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-01-21 11:14:34 +0100
commit112342b32650f56e289c7dcd181d5897b0b77a78 (patch)
tree76e9a37bcaa70097d009628bb2b116ea782c72cb /src/corelib
parent3bbc1bf53bac7648637d92abecadc568acfffb2d (diff)
parentb6191b16d41459ed73cea738dfaf8e25e81ae22b (diff)
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/doc/src/external-resources.qdoc11
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qendian.h12
-rw-r--r--src/corelib/global/qglobal.cpp78
-rw-r--r--src/corelib/global/qlibraryinfo.cpp7
-rw-r--r--src/corelib/global/qnamespace.qdoc2
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm1
-rw-r--r--src/corelib/io/qwindowspipewriter_p.h6
-rw-r--r--src/corelib/kernel/qobject.cpp10
-rw-r--r--src/corelib/kernel/qvariant.cpp49
-rw-r--r--src/corelib/kernel/qvariant.h6
-rw-r--r--src/corelib/thread/qatomic.cpp86
-rw-r--r--src/corelib/thread/qatomic.h96
-rw-r--r--src/corelib/thread/qthread.cpp4
-rw-r--r--src/corelib/tools/qbytearray.cpp3
-rw-r--r--src/corelib/tools/qbytearraymatcher.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp42
-rw-r--r--src/corelib/tools/qfreelist_p.h2
-rw-r--r--src/corelib/tools/qlocale_p.h6
-rw-r--r--src/corelib/tools/qmargins.cpp2
-rw-r--r--src/corelib/tools/qvsnprintf.cpp1
-rw-r--r--src/corelib/xml/qxmlstream.cpp4
23 files changed, 277 insertions, 161 deletions
diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc
index a4f1b8723a..03af1d81bf 100644
--- a/src/corelib/doc/src/external-resources.qdoc
+++ b/src/corelib/doc/src/external-resources.qdoc
@@ -55,3 +55,14 @@
\externalpage http://www.iana.org/assignments/character-sets/character-sets.xml
\title IANA character-sets encoding file
*/
+
+/*!
+ \externalpage http://doc-snapshot.qt-project.org/qt5-5.4/qtdesigner-manual.html
+ \title Using a Designer UI File in Your Application
+*/
+
+/*!
+ \externalpage http://doc-snapshot.qt-project.org/qt5-5.4/designer-widget-mode.html#the-property-editor
+ \title Qt Designer's Widget Editing Mode#The Property Editor
+*/
+*/
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 86621364ec..0b1374a3bb 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -35,6 +35,8 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
+# qlogging.cpp uses backtrace(3), which is in a separate library on the BSDs.
+
if(linux*|hurd*):!cross_compile:!static:!*-armcc* {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 77f6c48857..2881a0fcbd 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -142,6 +142,10 @@
# if defined(__INTEL_COMPILER)
/* Intel C++ also masquerades as GCC */
# define Q_CC_INTEL (__INTEL_COMPILER)
+# ifdef __clang__
+/* Intel C++ masquerades as Clang masquerading as GCC */
+# define Q_CC_CLANG 305
+# endif
# define Q_ASSUME_IMPL(expr) __assume(expr)
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
# if __INTEL_COMPILER >= 1300 && !defined(__APPLE__)
@@ -537,9 +541,11 @@
# define Q_COMPILER_RANGE_FOR
# define Q_COMPILER_RAW_STRINGS
# define Q_COMPILER_REF_QUALIFIERS
+# define Q_COMPILER_UNICODE_STRINGS
# define Q_COMPILER_UNRESTRICTED_UNIONS
# endif
# if __INTEL_COMPILER >= 1500
+# define Q_COMPILER_CONSTEXPR
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
# define Q_COMPILER_INHERITING_CONSTRUCTORS
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index 1d72ba0fae..957ba2ad63 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -87,9 +87,15 @@ template <typename T> inline T qFromUnaligned(const uchar *src)
*/
template <typename T> T qbswap(T source);
+#ifdef __has_builtin
+# define QT_HAS_BUILTIN(x) __has_builtin(x)
+#else
+# define QT_HAS_BUILTIN(x) 0
+#endif
+
// GCC 4.3 implemented all the intrinsics, but the 16-bit one only got implemented in 4.8;
// Clang 2.6 implemented the 32- and 64-bit but waited until 3.2 to implement the 16-bit one
-#if (defined(Q_CC_GNU) && Q_CC_GNU >= 403) || (defined(Q_CC_CLANG) && Q_CC_CLANG >= 206)
+#if (defined(Q_CC_GNU) && Q_CC_GNU >= 403) || QT_HAS_BUILTIN(__builtin_bswap32)
template <> inline quint64 qbswap<quint64>(quint64 source)
{
return __builtin_bswap64(source);
@@ -130,7 +136,7 @@ template <> inline quint32 qbswap<quint32>(quint32 source)
| ((source & 0xff000000) >> 24);
}
#endif // GCC & Clang intrinsics
-#if (defined(Q_CC_GNU) && Q_CC_GNU >= 408) || (defined(Q_CC_CLANG) && Q_CC_CLANG >= 302)
+#if (defined(Q_CC_GNU) && Q_CC_GNU >= 408) || QT_HAS_BUILTIN(__builtin_bswap16)
template <> inline quint16 qbswap<quint16>(quint16 source)
{
return __builtin_bswap16(source);
@@ -148,6 +154,8 @@ template <> inline quint16 qbswap<quint16>(quint16 source)
}
#endif // GCC & Clang intrinsics
+#undef QT_HAS_BUILTIN
+
// signed specializations
template <> inline qint64 qbswap<qint64>(qint64 source)
{
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 4895bf6dd9..0a9e2f97db 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -41,6 +41,8 @@
#include "qdatetime.h"
#include <private/qlocale_tools_p.h>
+#include <private/qsystemlibrary_p.h>
+
#ifndef QT_NO_QOBJECT
#include <private/qthread_p.h>
#endif
@@ -1876,6 +1878,70 @@ QT_BEGIN_INCLUDE_NAMESPACE
QT_END_INCLUDE_NAMESPACE
#ifndef Q_OS_WINRT
+
+# ifndef Q_OS_WINCE
+
+// Determine Windows versions >= 8 by querying the version of kernel32.dll.
+static inline bool determineWinOsVersionPost8(OSVERSIONINFO *result)
+{
+ typedef WORD (WINAPI* PtrGetFileVersionInfoSizeW)(LPCWSTR, LPDWORD);
+ typedef BOOL (WINAPI* PtrVerQueryValueW)(LPCVOID, LPCWSTR, LPVOID, PUINT);
+ typedef BOOL (WINAPI* PtrGetFileVersionInfoW)(LPCWSTR, DWORD, DWORD, LPVOID);
+
+ QSystemLibrary versionLib(QStringLiteral("version"));
+ if (!versionLib.load())
+ return false;
+ PtrGetFileVersionInfoSizeW getFileVersionInfoSizeW = (PtrGetFileVersionInfoSizeW)versionLib.resolve("GetFileVersionInfoSizeW");
+ PtrVerQueryValueW verQueryValueW = (PtrVerQueryValueW)versionLib.resolve("VerQueryValueW");
+ PtrGetFileVersionInfoW getFileVersionInfoW = (PtrGetFileVersionInfoW)versionLib.resolve("GetFileVersionInfoW");
+ if (!getFileVersionInfoSizeW || !verQueryValueW || !getFileVersionInfoW)
+ return false;
+
+ const wchar_t kernel32Dll[] = L"kernel32.dll";
+ DWORD handle;
+ const DWORD size = getFileVersionInfoSizeW(kernel32Dll, &handle);
+ if (!size)
+ return false;
+ QScopedArrayPointer<BYTE> versionInfo(new BYTE[size]);
+ if (!getFileVersionInfoW(kernel32Dll, handle, size, versionInfo.data()))
+ return false;
+ UINT uLen;
+ VS_FIXEDFILEINFO *fileInfo = Q_NULLPTR;
+ if (!verQueryValueW(versionInfo.data(), L"\\", (LPVOID *)&fileInfo, &uLen))
+ return false;
+ const DWORD fileVersionMS = fileInfo->dwFileVersionMS;
+ const DWORD fileVersionLS = fileInfo->dwFileVersionLS;
+ result->dwMajorVersion = HIWORD(fileVersionMS);
+ result->dwMinorVersion = LOWORD(fileVersionMS);
+ result->dwBuildNumber = HIWORD(fileVersionLS);
+ return true;
+}
+
+// Fallback for determining Windows versions >= 8 by looping using the
+// version check macros. Note that it will return build number=0 to avoid
+// inefficient looping.
+static inline void determineWinOsVersionFallbackPost8(OSVERSIONINFO *result)
+{
+ result->dwBuildNumber = 0;
+ DWORDLONG conditionMask = 0;
+ VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(conditionMask, VER_PLATFORMID, VER_EQUAL);
+ OSVERSIONINFOEX checkVersion = { sizeof(OSVERSIONINFOEX), result->dwMajorVersion, 0,
+ result->dwBuildNumber, result->dwPlatformId, {'\0'}, 0, 0, 0, 0, 0 };
+ for ( ; VerifyVersionInfo(&checkVersion, VER_MAJORVERSION | VER_PLATFORMID, conditionMask); ++checkVersion.dwMajorVersion)
+ result->dwMajorVersion = checkVersion.dwMajorVersion;
+ conditionMask = 0;
+ checkVersion.dwMajorVersion = result->dwMajorVersion;
+ checkVersion.dwMinorVersion = 0;
+ VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_EQUAL);
+ VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(conditionMask, VER_PLATFORMID, VER_EQUAL);
+ for ( ; VerifyVersionInfo(&checkVersion, VER_MAJORVERSION | VER_MINORVERSION | VER_PLATFORMID, conditionMask); ++checkVersion.dwMinorVersion)
+ result->dwMinorVersion = checkVersion.dwMinorVersion;
+}
+
+# endif // !Q_OS_WINCE
+
static inline OSVERSIONINFO winOsVersion()
{
OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}};
@@ -1891,16 +1957,8 @@ static inline OSVERSIONINFO winOsVersion()
# endif
# ifndef Q_OS_WINCE
if (result.dwMajorVersion == 6 && result.dwMinorVersion == 2) {
- // This could be Windows 8.1 or higher. Note that as of Windows 9,
- // the major version needs to be checked as well.
- DWORDLONG conditionMask = 0;
- VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(conditionMask, VER_PLATFORMID, VER_EQUAL);
- OSVERSIONINFOEX checkVersion = { sizeof(OSVERSIONINFOEX), result.dwMajorVersion, result.dwMinorVersion,
- result.dwBuildNumber, result.dwPlatformId, {'\0'}, 0, 0, 0, 0, 0 };
- for ( ; VerifyVersionInfo(&checkVersion, VER_MAJORVERSION | VER_MINORVERSION | VER_PLATFORMID, conditionMask); ++checkVersion.dwMinorVersion)
- result.dwMinorVersion = checkVersion.dwMinorVersion;
+ if (!determineWinOsVersionPost8(&result))
+ determineWinOsVersionFallbackPost8(&result);
}
# endif // !Q_OS_WINCE
return result;
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index c60ca7e9b0..575da452b9 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -116,10 +116,11 @@ QLibrarySettings::QLibrarySettings()
QStringList children = settings->childGroups();
#ifdef QT_BOOTSTRAPPED
haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths"));
- haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths"));
#else
- haveEffectivePaths = children.contains(QLatin1String("EffectivePaths"));
+ // EffectiveSourcePaths is for the Qt build only, so needs no backwards compat trickery.
+ bool haveEffectiveSourcePaths = false;
#endif
+ haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths"));
// Backwards compat: an existing but empty file is claimed to contain the Paths section.
havePaths = (!haveEffectivePaths && !children.contains(QLatin1String(platformsSection)))
|| children.contains(QLatin1String("Paths"));
@@ -128,9 +129,7 @@ QLibrarySettings::QLibrarySettings()
settings.reset(0);
#else
} else {
-#ifdef QT_BOOTSTRAPPED
haveEffectiveSourcePaths = false;
-#endif
haveEffectivePaths = false;
havePaths = false;
#endif
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 4b582642f3..c8aa53aced 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -592,7 +592,7 @@
string, "ddd MMM d yyyy". See QDate::toString() for more information.
\value ISODate \l{ISO 8601} extended format: either \c{YYYY-MM-DD} for dates or
- \c{YYYY-MM-DDTHH:MM:SS}, \c{YYYY-MM-DDTHH:MM:SSTZD} (e.g., 1997-07-16T19:20:30+01:00)
+ \c{YYYY-MM-DDTHH:mm:ss}, \c{YYYY-MM-DDTHH:mm:ssTZD} (e.g., 1997-07-16T19:20:30+01:00)
for combined dates and times.
\value SystemLocaleShortDate The \l{QLocale::ShortFormat}{short format} used
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index 4cd71d7d52..9d5d6de6ad 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -173,6 +173,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
case TempLocation:
return QDir::tempPath();
case GenericDataLocation:
+ case AppDataLocation:
case AppLocalDataLocation:
case GenericCacheLocation:
case CacheLocation:
diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h
index 47b7744e81..6035993500 100644
--- a/src/corelib/io/qwindowspipewriter_p.h
+++ b/src/corelib/io/qwindowspipewriter_p.h
@@ -45,7 +45,7 @@
// We mean it.
//
-#include <qdatetime.h>
+#include <qelapsedtimer.h>
#include <qthread.h>
#include <qmutex.h>
#include <qwaitcondition.h>
@@ -83,7 +83,7 @@ public:
{
if (totalTimeOut == -1)
return SLEEPMAX;
- return qMax(totalTimeOut - timer.elapsed(), 0);
+ return qMax(int(totalTimeOut - timer.elapsed()), 0);
}
bool hasTimedOut() const
@@ -99,7 +99,7 @@ public:
}
private:
- QTime timer;
+ QElapsedTimer timer;
int totalTimeOut;
int nextSleep;
};
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 2f9ef9ca4a..be6441933f 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2742,9 +2742,9 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const char *sign
You can check if the QMetaObject::Connection is valid by casting it to a bool.
This function works in the same way as
- connect(const QObject *sender, const char *signal,
+ \c {connect(const QObject *sender, const char *signal,
const QObject *receiver, const char *method,
- Qt::ConnectionType type)
+ Qt::ConnectionType type)}
but it uses QMetaMethod to specify signal and method.
\sa connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
@@ -2997,7 +2997,7 @@ bool QObject::disconnect(const QObject *sender, const char *signal,
otherwise returns \c false.
This function provides the same possibilities like
- disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
+ \c {disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method) }
but uses QMetaMethod to represent the signal and the method to be disconnected.
Additionally this function returnsfalse and no signals and slots disconnected
@@ -4113,7 +4113,7 @@ QDebug operator<<(QDebug dbg, const QObject *o)
This macro associates extra information to the class, which is available
using QObject::metaObject(). Qt makes only limited use of this feature, in
- the \l{Active Qt}, \l{Qt D-Bus} and \l{Qt QML} modules.
+ the \l{Active Qt}, \l{Qt D-Bus} and \l{Qt QML module}{Qt QML}.
The extra information takes the form of a \a Name string and a \a Value
literal string.
@@ -4125,7 +4125,7 @@ QDebug operator<<(QDebug dbg, const QObject *o)
\sa QMetaObject::classInfo()
\sa QAxFactory
\sa {Using Qt D-Bus Adaptors}
- \sa {Extending QML - Default Property Example}
+ \sa {Extending QML}
*/
/*!
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 3f958138b3..f7b8fe5ca5 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -4001,6 +4001,13 @@ void QAssociativeIterable::const_iterator::end()
m_impl.end();
}
+void find(QAssociativeIterable::const_iterator &it, const QVariant &key)
+{
+ Q_ASSERT(key.userType() == it.m_impl._metaType_id_key);
+ const QtMetaTypePrivate::VariantData dkey(key.userType(), key.constData(), 0 /*key.flags()*/);
+ it.m_impl.find(dkey);
+}
+
/*!
Returns a QAssociativeIterable::const_iterator for the beginning of the container. This
can be used in stl-style iteration.
@@ -4028,27 +4035,37 @@ QAssociativeIterable::const_iterator QAssociativeIterable::end() const
}
/*!
+ \internal
+
+ Returns a QAssociativeIterable::const_iterator for the given key \a key
+ in the container, if the types are convertible.
+
+ If the key is not found, returns end().
+
+ This can be used in stl-style iteration.
+
+ \sa begin(), end(), value()
+*/
+QAssociativeIterable::const_iterator find(const QAssociativeIterable &iterable, const QVariant &key)
+{
+ QAssociativeIterable::const_iterator it(iterable, new QAtomicInt(0));
+ QVariant key_ = key;
+ if (key_.canConvert(iterable.m_impl._metaType_id_key) && key_.convert(iterable.m_impl._metaType_id_key))
+ find(it, key_);
+ else
+ it.end();
+ return it;
+}
+
+/*!
Returns the value for the given \a key in the container, if the types are convertible.
*/
QVariant QAssociativeIterable::value(const QVariant &key) const
{
- QVariant key_ = key;
- if (!key_.canConvert(m_impl._metaType_id_key))
- return QVariant();
- if (!key_.convert(m_impl._metaType_id_key))
+ const const_iterator it = find(*this, key);
+ if (it == end())
return QVariant();
- const QtMetaTypePrivate::VariantData dkey(key_.userType(), key_.constData(), 0 /*key.flags()*/);
- QtMetaTypePrivate::QAssociativeIterableImpl impl = m_impl;
- impl.find(dkey);
- QtMetaTypePrivate::QAssociativeIterableImpl endIt = m_impl;
- endIt.end();
- if (impl.equal(endIt))
- return QVariant();
- const QtMetaTypePrivate::VariantData d = impl.getCurrentValue();
- QVariant v(d.metaTypeId, d.data, d.flags);
- if (d.metaTypeId == qMetaTypeId<QVariant>())
- return *reinterpret_cast<const QVariant*>(d.data);
- return v;
+ return *it;
}
/*!
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 7bee756fa5..c33ac834c0 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -633,6 +633,9 @@ public:
void begin();
void end();
+ // ### Qt 5.5: make find() (1st one) a member function
+ friend void find(const_iterator &it, const QVariant &key);
+ friend const_iterator find(const QAssociativeIterable &iterable, const QVariant &key);
public:
~const_iterator();
const_iterator(const const_iterator &other);
@@ -662,6 +665,9 @@ public:
const_iterator begin() const;
const_iterator end() const;
+private: // ### Qt 5.5: make it a public find() member function:
+ friend const_iterator find(const QAssociativeIterable &iterable, const QVariant &key);
+public:
QVariant value(const QVariant &key) const;
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp
index 2ac32d5d6b..0f4c8efb03 100644
--- a/src/corelib/thread/qatomic.cpp
+++ b/src/corelib/thread/qatomic.cpp
@@ -250,7 +250,7 @@
/*!
- \fn int QAtomicInteger::load() const
+ \fn T QAtomicInteger::load() const
Atomically loads the value of this QAtomicInteger using relaxed memory
ordering. The value is not modified in any way, but note that there's no
@@ -260,7 +260,7 @@
*/
/*!
- \fn int QAtomicInteger::loadAcquire() const
+ \fn T QAtomicInteger::loadAcquire() const
Atomically loads the value of this QAtomicInteger using the "Acquire" memory
ordering. The value is not modified in any way, but note that there's no
@@ -270,7 +270,7 @@
*/
/*!
- \fn void QAtomicInteger::store(int newValue)
+ \fn void QAtomicInteger::store(T newValue)
Atomically stores the \a newValue value into this atomic type, using
relaxed memory ordering.
@@ -279,7 +279,7 @@
*/
/*!
- \fn void QAtomicInteger::storeRelease(int newValue)
+ \fn void QAtomicInteger::storeRelease(T newValue)
Atomically stores the \a newValue value into this atomic type, using
the "Release" memory ordering.
@@ -288,7 +288,7 @@
*/
/*!
- \fn QAtomicInteger::operator int() const
+ \fn QAtomicInteger::operator T() const
\since 5.3
Atomically loads the value of this QAtomicInteger using a sequentially
@@ -300,7 +300,7 @@
*/
/*!
- \fn QAtomicInteger &QAtomicInteger::operator=(int newValue)
+ \fn QAtomicInteger &QAtomicInteger::operator=(T newValue)
\since 5.3
Atomically stores the \a newValue value into this atomic type using a
@@ -335,7 +335,7 @@
*/
/*!
- \fn int QAtomicInteger::operator++()
+ \fn T QAtomicInteger::operator++()
\since 5.3
Atomically pre-increments the value of this QAtomicInteger. Returns the new
@@ -348,7 +348,7 @@
*/
/*!
- \fn int QAtomicInteger::operator++(int)
+ \fn T QAtomicInteger::operator++(int)
\since 5.3
Atomically post-increments the value of this QAtomicInteger. Returns the old
@@ -373,7 +373,7 @@
*/
/*!
- \fn int QAtomicInteger::operator--()
+ \fn T QAtomicInteger::operator--()
\since 5.3
Atomically pre-decrements the value of this QAtomicInteger. Returns the new
@@ -386,7 +386,7 @@
*/
/*!
- \fn int QAtomicInteger::operator--(int)
+ \fn T QAtomicInteger::operator--(int)
\since 5.3
Atomically post-decrements the value of this QAtomicInteger. Returns the old
@@ -409,7 +409,7 @@
Returns \c true if atomic test-and-set is wait-free, false otherwise.
*/
-/*! \fn bool QAtomicInteger::testAndSetRelaxed(int expectedValue, int newValue)
+/*! \fn bool QAtomicInteger::testAndSetRelaxed(T expectedValue, T newValue)
Atomic test-and-set.
@@ -423,7 +423,7 @@
processor to freely reorder memory accesses.
*/
-/*! \fn bool QAtomicInteger::testAndSetAcquire(int expectedValue, int newValue)
+/*! \fn bool QAtomicInteger::testAndSetAcquire(T expectedValue, T newValue)
Atomic test-and-set.
@@ -438,7 +438,7 @@
be re-ordered before the atomic operation.
*/
-/*! \fn bool QAtomicInteger::testAndSetRelease(int expectedValue, int newValue)
+/*! \fn bool QAtomicInteger::testAndSetRelease(T expectedValue, T newValue)
Atomic test-and-set.
@@ -453,7 +453,7 @@
re-ordered after the atomic operation.
*/
-/*! \fn bool QAtomicInteger::testAndSetOrdered(int expectedValue, int newValue)
+/*! \fn bool QAtomicInteger::testAndSetOrdered(T expectedValue, T newValue)
Atomic test-and-set.
@@ -480,7 +480,7 @@
otherwise.
*/
-/*! \fn int QAtomicInteger::fetchAndStoreRelaxed(int newValue)
+/*! \fn T QAtomicInteger::fetchAndStoreRelaxed(T newValue)
Atomic fetch-and-store.
@@ -492,7 +492,7 @@
processor to freely reorder memory accesses.
*/
-/*! \fn int QAtomicInteger::fetchAndStoreAcquire(int newValue)
+/*! \fn T QAtomicInteger::fetchAndStoreAcquire(T newValue)
Atomic fetch-and-store.
@@ -505,7 +505,7 @@
be re-ordered before the atomic operation.
*/
-/*! \fn int QAtomicInteger::fetchAndStoreRelease(int newValue)
+/*! \fn T QAtomicInteger::fetchAndStoreRelease(T newValue)
Atomic fetch-and-store.
@@ -518,7 +518,7 @@
re-ordered after the atomic operation.
*/
-/*! \fn int QAtomicInteger::fetchAndStoreOrdered(int newValue)
+/*! \fn T QAtomicInteger::fetchAndStoreOrdered(T newValue)
Atomic fetch-and-store.
@@ -543,7 +543,7 @@
otherwise.
*/
-/*! \fn int QAtomicInteger::fetchAndAddRelaxed(int valueToAdd)
+/*! \fn T QAtomicInteger::fetchAndAddRelaxed(T valueToAdd)
Atomic fetch-and-add.
@@ -557,7 +557,7 @@
\sa operator+=(), fetchAndSubRelaxed()
*/
-/*! \fn int QAtomicInteger::fetchAndAddAcquire(int valueToAdd)
+/*! \fn T QAtomicInteger::fetchAndAddAcquire(T valueToAdd)
Atomic fetch-and-add.
@@ -572,7 +572,7 @@
\sa operator+=(), fetchAndSubAcquire()
*/
-/*! \fn int QAtomicInteger::fetchAndAddRelease(int valueToAdd)
+/*! \fn T QAtomicInteger::fetchAndAddRelease(T valueToAdd)
Atomic fetch-and-add.
@@ -587,7 +587,7 @@
\sa operator+=(), fetchAndSubRelease()
*/
-/*! \fn int QAtomicInteger::fetchAndAddOrdered(int valueToAdd)
+/*! \fn T QAtomicInteger::fetchAndAddOrdered(T valueToAdd)
Atomic fetch-and-add.
@@ -602,7 +602,7 @@
\sa operator+=(), fetchAndSubOrdered()
*/
-/*! \fn int QAtomicInteger::operator+=(int valueToAdd)
+/*! \fn T QAtomicInteger::operator+=(T valueToAdd)
\since 5.3
Atomic add-and-fetch.
@@ -616,7 +616,7 @@
\sa fetchAndAddOrdered(), operator-=()
*/
-/*! \fn int QAtomicInteger::fetchAndSubRelaxed(int valueToSub)
+/*! \fn T QAtomicInteger::fetchAndSubRelaxed(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@@ -631,7 +631,7 @@
\sa operator-=(), fetchAndAddRelaxed()
*/
-/*! \fn int QAtomicInteger::fetchAndSubAcquire(int valueToSub)
+/*! \fn T QAtomicInteger::fetchAndSubAcquire(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@@ -647,7 +647,7 @@
\sa operator-=(), fetchAndAddAcquire()
*/
-/*! \fn int QAtomicInteger::fetchAndSubRelease(int valueToSub)
+/*! \fn T QAtomicInteger::fetchAndSubRelease(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@@ -663,7 +663,7 @@
\sa operator-=(), fetchAndAddRelease()
*/
-/*! \fn int QAtomicInteger::fetchAndSubOrdered(int valueToSub)
+/*! \fn T QAtomicInteger::fetchAndSubOrdered(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@@ -679,7 +679,7 @@
\sa operator-=(), fetchAndAddOrdered()
*/
-/*! \fn int QAtomicInteger::operator-=(int valueToSub)
+/*! \fn T QAtomicInteger::operator-=(T valueToSub)
\since 5.3
Atomic sub-and-fetch.
@@ -693,7 +693,7 @@
\sa fetchAndSubOrdered(), operator+=()
*/
-/*! \fn int QAtomicInteger::fetchAndOrRelaxed(int valueToOr)
+/*! \fn T QAtomicInteger::fetchAndOrRelaxed(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@@ -708,7 +708,7 @@
\sa operator|=()
*/
-/*! \fn int QAtomicInteger::fetchAndOrAcquire(int valueToOr)
+/*! \fn T QAtomicInteger::fetchAndOrAcquire(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@@ -724,7 +724,7 @@
\sa operator|=()
*/
-/*! \fn int QAtomicInteger::fetchAndOrRelease(int valueToOr)
+/*! \fn T QAtomicInteger::fetchAndOrRelease(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@@ -740,7 +740,7 @@
\sa operator|=()
*/
-/*! \fn int QAtomicInteger::fetchAndOrOrdered(int valueToOr)
+/*! \fn T QAtomicInteger::fetchAndOrOrdered(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@@ -756,7 +756,7 @@
\sa operator|=()
*/
-/*! \fn int QAtomicInteger::operator|=(int valueToOr)
+/*! \fn T QAtomicInteger::operator|=(T valueToOr)
\since 5.3
Atomic or-and-fetch.
@@ -770,7 +770,7 @@
\sa fetchAndOrOrdered()
*/
-/*! \fn int QAtomicInteger::fetchAndXorRelaxed(int valueToXor)
+/*! \fn T QAtomicInteger::fetchAndXorRelaxed(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@@ -785,7 +785,7 @@
\sa operator^=()
*/
-/*! \fn int QAtomicInteger::fetchAndXorAcquire(int valueToXor)
+/*! \fn T QAtomicInteger::fetchAndXorAcquire(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@@ -801,7 +801,7 @@
\sa operator^=()
*/
-/*! \fn int QAtomicInteger::fetchAndXorRelease(int valueToXor)
+/*! \fn T QAtomicInteger::fetchAndXorRelease(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@@ -817,7 +817,7 @@
\sa operator^=()
*/
-/*! \fn int QAtomicInteger::fetchAndXorOrdered(int valueToXor)
+/*! \fn T QAtomicInteger::fetchAndXorOrdered(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@@ -833,7 +833,7 @@
\sa operator^=()
*/
-/*! \fn int QAtomicInteger::operator^=(int valueToXor)
+/*! \fn T QAtomicInteger::operator^=(T valueToXor)
\since 5.3
Atomic xor-and-fetch.
@@ -847,7 +847,7 @@
\sa fetchAndXorOrdered()
*/
-/*! \fn int QAtomicInteger::fetchAndAndRelaxed(int valueToAnd)
+/*! \fn T QAtomicInteger::fetchAndAndRelaxed(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@@ -862,7 +862,7 @@
\sa operator&=()
*/
-/*! \fn int QAtomicInteger::fetchAndAndAcquire(int valueToAnd)
+/*! \fn T QAtomicInteger::fetchAndAndAcquire(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@@ -878,7 +878,7 @@
\sa operator&=()
*/
-/*! \fn int QAtomicInteger::fetchAndAndRelease(int valueToAnd)
+/*! \fn T QAtomicInteger::fetchAndAndRelease(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@@ -894,7 +894,7 @@
\sa operator&=()
*/
-/*! \fn int QAtomicInteger::fetchAndAndOrdered(int valueToAnd)
+/*! \fn T QAtomicInteger::fetchAndAndOrdered(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@@ -910,7 +910,7 @@
\sa operator&=()
*/
-/*! \fn int QAtomicInteger::operator&=(int valueToAnd)
+/*! \fn T QAtomicInteger::operator&=(T valueToAnd)
\since 5.3
Atomic add-and-fetch.
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index a665746db4..c273973472 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -73,13 +73,13 @@ public:
}
#ifdef Q_QDOC
- int load() const;
- int loadAcquire() const;
- void store(int newValue);
- void storeRelease(int newValue);
+ T load() const;
+ T loadAcquire() const;
+ void store(T newValue);
+ void storeRelease(T newValue);
- operator int() const;
- QAtomicInteger &operator=(int);
+ operator T() const;
+ QAtomicInteger &operator=(T);
static Q_DECL_CONSTEXPR bool isReferenceCountingNative();
static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree();
@@ -90,56 +90,56 @@ public:
static Q_DECL_CONSTEXPR bool isTestAndSetNative();
static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree();
- bool testAndSetRelaxed(int expectedValue, int newValue);
- bool testAndSetAcquire(int expectedValue, int newValue);
- bool testAndSetRelease(int expectedValue, int newValue);
- bool testAndSetOrdered(int expectedValue, int newValue);
+ bool testAndSetRelaxed(T expectedValue, T newValue);
+ bool testAndSetAcquire(T expectedValue, T newValue);
+ bool testAndSetRelease(T expectedValue, T newValue);
+ bool testAndSetOrdered(T expectedValue, T newValue);
static Q_DECL_CONSTEXPR bool isFetchAndStoreNative();
static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree();
- int fetchAndStoreRelaxed(int newValue);
- int fetchAndStoreAcquire(int newValue);
- int fetchAndStoreRelease(int newValue);
- int fetchAndStoreOrdered(int newValue);
+ T fetchAndStoreRelaxed(T newValue);
+ T fetchAndStoreAcquire(T newValue);
+ T fetchAndStoreRelease(T newValue);
+ T fetchAndStoreOrdered(T newValue);
static Q_DECL_CONSTEXPR bool isFetchAndAddNative();
static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree();
- int fetchAndAddRelaxed(int valueToAdd);
- int fetchAndAddAcquire(int valueToAdd);
- int fetchAndAddRelease(int valueToAdd);
- int fetchAndAddOrdered(int valueToAdd);
-
- int fetchAndSubRelaxed(int valueToSub);
- int fetchAndSubAcquire(int valueToSub);
- int fetchAndSubRelease(int valueToSub);
- int fetchAndSubOrdered(int valueToSub);
-
- int fetchAndOrRelaxed(int valueToOr);
- int fetchAndOrAcquire(int valueToOr);
- int fetchAndOrRelease(int valueToOr);
- int fetchAndOrOrdered(int valueToOr);
-
- int fetchAndAndRelaxed(int valueToAnd);
- int fetchAndAndAcquire(int valueToAnd);
- int fetchAndAndRelease(int valueToAnd);
- int fetchAndAndOrdered(int valueToAnd);
-
- int fetchAndXorRelaxed(int valueToXor);
- int fetchAndXorAcquire(int valueToXor);
- int fetchAndXorRelease(int valueToXor);
- int fetchAndXorOrdered(int valueToXor);
-
- int operator++();
- int operator++(int);
- int operator--();
- int operator--(int);
- int operator+=(int value);
- int operator-=(int value);
- int operator|=(int value);
- int operator&=(int value);
- int operator^=(int value);
+ T fetchAndAddRelaxed(T valueToAdd);
+ T fetchAndAddAcquire(T valueToAdd);
+ T fetchAndAddRelease(T valueToAdd);
+ T fetchAndAddOrdered(T valueToAdd);
+
+ T fetchAndSubRelaxed(T valueToSub);
+ T fetchAndSubAcquire(T valueToSub);
+ T fetchAndSubRelease(T valueToSub);
+ T fetchAndSubOrdered(T valueToSub);
+
+ T fetchAndOrRelaxed(T valueToOr);
+ T fetchAndOrAcquire(T valueToOr);
+ T fetchAndOrRelease(T valueToOr);
+ T fetchAndOrOrdered(T valueToOr);
+
+ T fetchAndAndRelaxed(T valueToAnd);
+ T fetchAndAndAcquire(T valueToAnd);
+ T fetchAndAndRelease(T valueToAnd);
+ T fetchAndAndOrdered(T valueToAnd);
+
+ T fetchAndXorRelaxed(T valueToXor);
+ T fetchAndXorAcquire(T valueToXor);
+ T fetchAndXorRelease(T valueToXor);
+ T fetchAndXorOrdered(T valueToXor);
+
+ T operator++();
+ T operator++(int);
+ T operator--();
+ T operator--(int);
+ T operator+=(T value);
+ T operator-=(T value);
+ T operator|=(T value);
+ T operator&=(T value);
+ T operator^=(T value);
#endif
};
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 3caad7c4b2..933fd06afa 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -178,7 +178,7 @@ QThreadPrivate::~QThreadPrivate()
event loop by calling exec() and runs a Qt event loop inside the thread.
You can use worker objects by moving them to the thread using
- QObject::moveToThread.
+ QObject::moveToThread().
\snippet code/src_corelib_thread_qthread.cpp worker
@@ -256,7 +256,7 @@ QThreadPrivate::~QThreadPrivate()
\l{Mandelbrot Example}, as that is the name of the QThread subclass).
Note that this is currently not available with release builds on Windows.
- \sa {Thread Support in Qt}, QThreadStorage, {Synchronizing Threads}
+ \sa {Thread Support in Qt}, QThreadStorage, {Synchronizing Threads},
{Mandelbrot Example}, {Semaphores Example}, {Wait Conditions Example}
*/
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index a267dc6f7b..a683a36f61 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -45,6 +45,7 @@
#include <qmath.h>
#ifndef QT_NO_COMPRESS
+#include <zconf.h>
#include <zlib.h>
#endif
#include <ctype.h>
@@ -4017,7 +4018,7 @@ QByteArray QByteArray::fromRawData(const char *data, int size)
copies of it exist that have not been modified.
This function can be used instead of fromRawData() to re-use
- existings QByteArray objects to save memory re-allocations.
+ existing QByteArray objects to save memory re-allocations.
\sa fromRawData(), data(), constData()
*/
diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp
index f14d941c27..82f012be66 100644
--- a/src/corelib/tools/qbytearraymatcher.cpp
+++ b/src/corelib/tools/qbytearraymatcher.cpp
@@ -256,7 +256,7 @@ static int qFindByteArrayBoyerMoore(
#define REHASH(a) \
if (sl_minus_1 < sizeof(uint) * CHAR_BIT) \
- hashHaystack -= (a) << sl_minus_1; \
+ hashHaystack -= uint(a) << sl_minus_1; \
hashHaystack <<= 1
/*!
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 3326044b43..b95ccc0874 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -182,7 +182,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
int minOffset = 0;
bool positiveOffset = false;
- // Matches "Wdy, DD Mon YYYY HH:MM:SS ±hhmm" (Wdy, being optional)
+ // Matches "Wdy, DD Mon YYYY HH:mm:ss ±hhmm" (Wdy, being optional)
QRegExp rex(QStringLiteral("^(?:[A-Z][a-z]+,)?[ \\t]*(\\d{1,2})[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d)(?::(\\d\\d))?)?[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?"));
if (s.indexOf(rex) == 0) {
if (dd) {
@@ -203,7 +203,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
if (utcOffset)
*utcOffset = ((hourOffset * 60 + minOffset) * (positiveOffset ? 60 : -60));
} else {
- // Matches "Wdy Mon DD HH:MM:SS YYYY"
+ // Matches "Wdy Mon DD HH:mm:ss YYYY"
QRegExp rex(QStringLiteral("^[A-Z][a-z]+[ \\t]+([A-Z][a-z]+)[ \\t]+(\\d\\d)(?:[ \\t]+(\\d\\d):(\\d\\d):(\\d\\d))?[ \\t]+(\\d\\d\\d\\d)[ \\t]*(?:([+-])(\\d\\d)(\\d\\d))?"));
if (s.indexOf(rex) == 0) {
if (dd) {
@@ -233,7 +233,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
}
#endif // QT_NO_DATESTRING
-// Return offset in [+-]HH:MM format
+// Return offset in [+-]HH:mm format
// Qt::ISODate puts : between the hours and minutes, but Qt:TextDate does not
static QString toOffsetString(Qt::DateFormat format, int offset)
{
@@ -248,7 +248,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
.arg((qAbs(offset) / 60) % 60, 2, 10, QLatin1Char('0'));
}
-// Parse offset in [+-]HH[:]MM format
+// Parse offset in [+-]HH[[:]mm] format
static int fromOffsetString(const QStringRef &offsetString, bool *valid)
{
*valid = false;
@@ -272,7 +272,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid)
// Split the hour and minute parts
QVector<QStringRef> parts = offsetString.mid(1).split(QLatin1Char(':'));
if (parts.count() == 1) {
- // [+-]HHMM format
+ // [+-]HHmm or [+-]HH format
parts.append(parts.first().mid(2));
parts[0] = parts.first().left(2);
}
@@ -282,7 +282,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid)
if (!ok)
return 0;
- const int minute = parts.at(1).toInt(&ok);
+ const int minute = (parts.at(1).isEmpty()) ? 0 : parts.at(1).toInt(&ok);
if (!ok || minute < 0 || minute > 59)
return 0;
@@ -1598,12 +1598,12 @@ int QTime::msec() const
Returns the time as a string. The \a format parameter determines
the format of the string.
- If \a format is Qt::TextDate, the string format is HH:MM:SS;
+ If \a format is Qt::TextDate, the string format is HH:mm:ss;
e.g. 1 second before midnight would be "23:59:59".
If \a format is Qt::ISODate, the string format corresponds to the
ISO 8601 extended specification for representations of dates,
- which is also HH:MM:SS.
+ which is also HH:mm:ss.
If the \a format is Qt::SystemLocaleShortDate or
Qt::SystemLocaleLongDate, the string format depends on the locale
@@ -1925,13 +1925,13 @@ static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format,
int msec = 0;
if (size == 5) {
- // HH:MM format
+ // HH:mm format
second = 0;
msec = 0;
} else if (string.at(5) == QLatin1Char(',') || string.at(5) == QLatin1Char('.')) {
if (format == Qt::TextDate)
return QTime();
- // ISODate HH:MM.SSSSSS format
+ // ISODate HH:mm.ssssss format
// We only want 5 digits worth of fraction of minute. This follows the existing
// behavior that determines how milliseconds are read; 4 millisecond digits are
// read and then rounded to 3. If we read at most 5 digits for fraction of minute,
@@ -1951,7 +1951,7 @@ static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format,
second = secondNoMs;
msec = qMin(qRound(secondFraction * 1000.0), 999);
} else {
- // HH:MM:SS or HH:MM:SS.sssss
+ // HH:mm:ss or HH:mm:ss.zzz
second = string.mid(6, 2).toInt(&ok);
if (!ok)
return QTime();
@@ -3294,8 +3294,8 @@ bool QDateTime::isDaylightTime() const
}
/*!
- Sets the date part of this datetime to \a date.
- If no time is set, it is set to midnight.
+ Sets the date part of this datetime to \a date. If no time is set yet, it
+ is set to midnight. If \a date is invalid, this QDateTime becomes invalid.
\sa date(), setTime(), setTimeSpec()
*/
@@ -3307,7 +3307,14 @@ void QDateTime::setDate(const QDate &date)
}
/*!
- Sets the time part of this datetime to \a time.
+ Sets the time part of this datetime to \a time. If \a time is not valid,
+ this function sets it to midnight. Therefore, it's possible to clear any
+ set time in a QDateTime by setting it to a default QTime:
+
+ \code
+ QDateTime dt = QDateTime::currentDateTime();
+ dt.setTime(QTime());
+ \endcode
\sa time(), setDate(), setTimeSpec()
*/
@@ -3533,7 +3540,7 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC)
If the \a format is Qt::ISODate, the string format corresponds
to the ISO 8601 extended specification for representations of
- dates and times, taking the form YYYY-MM-DDTHH:MM:SS[Z|[+|-]HH:MM],
+ dates and times, taking the form YYYY-MM-DDTHH:mm:ss[Z|[+|-]HH:mm],
depending on the timeSpec() of the QDateTime. If the timeSpec()
is Qt::UTC, Z will be appended to the string; if the timeSpec() is
Qt::OffsetFromUTC, the offset in hours and minutes from UTC will
@@ -4452,15 +4459,14 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
isoString = isoString.right(isoString.length() - 11);
int offset = 0;
- // Check end of string for Time Zone definition, either Z for UTC or [+-]HH:MM for Offset
+ // Check end of string for Time Zone definition, either Z for UTC or [+-]HH:mm for Offset
if (isoString.endsWith(QLatin1Char('Z'))) {
spec = Qt::UTC;
isoString = isoString.left(isoString.size() - 1);
} else {
// the loop below is faster but functionally equal to:
// const int signIndex = isoString.indexOf(QRegExp(QStringLiteral("[+-]")));
- const int sizeOfTimeZoneString = 4;
- int signIndex = isoString.size() - sizeOfTimeZoneString - 1;
+ int signIndex = isoString.size() - 1;
bool found = false;
{
const QChar plus = QLatin1Char('+');
diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h
index bfb03fb723..189140016c 100644
--- a/src/corelib/tools/qfreelist_p.h
+++ b/src/corelib/tools/qfreelist_p.h
@@ -171,7 +171,7 @@ class QFreeList
// take the current serial number from \a o, increment it, and store it in \a n
static inline int incrementserial(int o, int n)
{
- return (n & ConstantsType::IndexMask) | ((o + ConstantsType::SerialCounter) & ConstantsType::SerialMask);
+ return int((uint(n) & ConstantsType::IndexMask) | ((uint(o) + ConstantsType::SerialCounter) & ConstantsType::SerialMask));
}
// the blocks
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index c5e62027c4..4e3022478a 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -418,9 +418,9 @@ Q_STATIC_ASSERT(!ascii_isspace('\0'));
Q_STATIC_ASSERT(!ascii_isspace('\a'));
Q_STATIC_ASSERT(!ascii_isspace('a'));
Q_STATIC_ASSERT(!ascii_isspace('\177'));
-Q_STATIC_ASSERT(!ascii_isspace('\200'));
-Q_STATIC_ASSERT(!ascii_isspace('\xA0'));
-Q_STATIC_ASSERT(!ascii_isspace('\377'));
+Q_STATIC_ASSERT(!ascii_isspace(uchar('\200')));
+Q_STATIC_ASSERT(!ascii_isspace(uchar('\xA0')));
+Q_STATIC_ASSERT(!ascii_isspace(uchar('\377')));
#endif
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp
index 419551aaca..265e44bfcf 100644
--- a/src/corelib/tools/qmargins.cpp
+++ b/src/corelib/tools/qmargins.cpp
@@ -484,7 +484,7 @@ QDebug operator<<(QDebug dbg, const QMargins &m) {
/*!
\fn bool QMarginsF::isNull() const
- Returns \c true if all margins are is 0; otherwise returns
+ Returns \c true if all margins are 0; otherwise returns
false.
*/
diff --git a/src/corelib/tools/qvsnprintf.cpp b/src/corelib/tools/qvsnprintf.cpp
index cf595b8f31..be92e20fac 100644
--- a/src/corelib/tools/qvsnprintf.cpp
+++ b/src/corelib/tools/qvsnprintf.cpp
@@ -97,6 +97,7 @@ int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
#endif
/*!
+ \target bytearray-qsnprintf
\relates QByteArray
A portable snprintf() function, calls qvsnprintf.
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 9928098a33..fe3c4049ad 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -726,7 +726,7 @@ static const short QXmlStreamReader_tokenTypeString_indices[] = {
/*!
\property QXmlStreamReader::namespaceProcessing
- the namespace-processing flag of the stream reader
+ The namespace-processing flag of the stream reader
This property controls whether or not the stream reader processes
namespaces. If enabled, the reader processes namespaces, otherwise
@@ -3306,7 +3306,7 @@ QTextCodec *QXmlStreamWriter::codec() const
/*!
\property QXmlStreamWriter::autoFormatting
\since 4.4
- the auto-formatting flag of the stream writer
+ The auto-formatting flag of the stream writer
This property controls whether or not the stream writer
automatically formats the generated XML data. If enabled, the