summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-20 13:46:21 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-23 21:09:46 +0200
commit56d6e000f7487c59172330ebd23a718268c508f1 (patch)
tree1494432583b1569816075091a8075b31d795f77c /src/corelib
parent9fd407fc6a29c94b4568dd042a05c208255179e0 (diff)
parentc276aa51303b7c6f8e4cd854aadf8344a906e50f (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/corelib/global/qglobal.h9
-rw-r--r--src/corelib/global/qlogging.cpp140
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc11
-rw-r--r--src/corelib/global/qprocessordetection.h2
-rw-r--r--src/corelib/io/qdebug.cpp11
-rw-r--r--src/corelib/io/qdebug.h9
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp2
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp66
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp4
-rw-r--r--src/corelib/kernel/qvariant.cpp22
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp6
-rw-r--r--src/corelib/thread/qbasicatomic.h4
-rw-r--r--src/corelib/thread/qmutex_linux.cpp41
-rw-r--r--src/corelib/tools/qarraydata.cpp6
-rw-r--r--src/corelib/tools/qarraydata.h4
-rw-r--r--src/corelib/tools/qarraydatapointer.h2
-rw-r--r--src/corelib/tools/qcontiguouscache.h2
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp17
-rw-r--r--src/corelib/tools/qelapsedtimer_unix.cpp3
-rw-r--r--src/corelib/tools/qhash.h5
-rw-r--r--src/corelib/tools/qhashfunctions.h3
-rw-r--r--src/corelib/tools/qlinkedlist.h2
-rw-r--r--src/corelib/tools/qlist.h2
-rw-r--r--src/corelib/tools/qmap.h2
-rw-r--r--src/corelib/tools/qrefcount.h6
-rw-r--r--src/corelib/tools/qset.h2
-rw-r--r--src/corelib/tools/qsharedpointer.cpp11
-rw-r--r--src/corelib/tools/qsharedpointer.h2
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h11
-rw-r--r--src/corelib/tools/qsimd.cpp6
-rw-r--r--src/corelib/tools/qvector.h8
-rw-r--r--src/corelib/tools/tools.pri1
36 files changed, 246 insertions, 185 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index aea3f54bb5..ccf9aaa612 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -8,7 +8,7 @@ MODULE_CONFIG = moc resources
CONFIG += $$MODULE_CONFIG
DEFINES += $$MODULE_DEFINES
-DEFINES += QT_NO_USING_NAMESPACE
+DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index e98f06d47d..3d64708def 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -4,7 +4,7 @@ project = QtCore
description = Qt Core Reference Documentation
version = $QT_VERSION
-examplesinstallpath = qtbase/corelib
+examplesinstallpath = corelib
qhp.projects = QtCore
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 38ced26ea4..78b7cec915 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -61,6 +61,9 @@
#include <QtCore/qfeatures.h>
#endif
+// The QT_SUPPORTS macro is deprecated. Don't use it in new code.
+// Instead, use #ifdef/ndef QT_NO_feature.
+// ### Qt6: remove macro
#ifdef _MSC_VER
# define QT_SUPPORTS(FEATURE) (!defined QT_NO_##FEATURE)
#else
@@ -920,6 +923,8 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
# endif
#endif
+#ifndef QT_NO_FOREACH
+
template <typename T>
class QForeachContainer {
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
@@ -945,11 +950,15 @@ for (QForeachContainer<typename QtPrivate::remove_reference<decltype(container)>
++_container_.i, _container_.control ^= 1) \
for (variable = *_container_.i; _container_.control; _container_.control = 0)
+#endif // QT_NO_FOREACH
+
#define Q_FOREVER for(;;)
#ifndef QT_NO_KEYWORDS
+# ifndef QT_NO_FOREACH
# ifndef foreach
# define foreach Q_FOREACH
# endif
+# endif // QT_NO_FOREACH
# ifndef forever
# define forever Q_FOREVER
# endif
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 6dc453009b..0fe095b8d3 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -54,6 +54,7 @@
#include "qthread.h"
#include "private/qloggingregistry_p.h"
#include "private/qcoreapplication_p.h"
+#include "private/qsimd_p.h"
#endif
#ifdef Q_OS_WIN
#include <qt_windows.h>
@@ -1193,6 +1194,89 @@ void QMessagePattern::setPattern(const QString &pattern)
memcpy(literals, literalsVar.constData(), literalsVar.size() * sizeof(const char*));
}
+#if defined(QLOGGING_HAVE_BACKTRACE) && !defined(QT_BOOTSTRAPPED)
+// make sure the function has "Message" in the name so the function is removed
+
+#if (defined(Q_CC_GNU) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) || QT_HAS_ATTRIBUTE(optimize)
+// force skipping the frame pointer, to save the backtrace() function some work
+__attribute__((optimize("omit-frame-pointer")))
+#endif
+static QStringList backtraceFramesForLogMessage(int frameCount)
+{
+ QStringList result;
+ if (frameCount == 0)
+ return result;
+
+ // The results of backtrace_symbols looks like this:
+ // /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
+ // The offset and function name are optional.
+ // This regexp tries to extract the library name (without the path) and the function name.
+ // This code is protected by QMessagePattern::mutex so it is thread safe on all compilers
+ static QRegularExpression rx(QStringLiteral("^(?:[^(]*/)?([^(/]+)\\(([^+]*)(?:[\\+[a-f0-9x]*)?\\) \\[[a-f0-9x]*\\]$"),
+ QRegularExpression::OptimizeOnFirstUsageOption);
+
+ QVarLengthArray<void*, 32> buffer(7 + frameCount);
+ int n = backtrace(buffer.data(), buffer.size());
+ if (n > 0) {
+ int numberPrinted = 0;
+ for (int i = 0; i < n && numberPrinted < frameCount; ++i) {
+ QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
+ QString trace = QString::fromLatin1(strings.data()[0]);
+ QRegularExpressionMatch m = rx.match(trace);
+ if (m.hasMatch()) {
+ QString library = m.captured(1);
+ QString function = m.captured(2);
+
+ // skip the trace from QtCore that are because of the qDebug itself
+ if (!numberPrinted && library.contains(QLatin1String("Qt5Core"))
+ && (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive)
+ || function.contains(QLatin1String("QDebug")))) {
+ continue;
+ }
+
+ if (function.startsWith(QLatin1String("_Z"))) {
+ QScopedPointer<char, QScopedPointerPodDeleter> demangled(
+ abi::__cxa_demangle(function.toUtf8(), 0, 0, 0));
+ if (demangled)
+ function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
+ }
+
+ if (function.isEmpty()) {
+ result.append(QLatin1Char('?') + library + QLatin1Char('?'));
+ } else {
+ result.append(function);
+ }
+ } else {
+ if (numberPrinted == 0) {
+ // innermost, unknown frames are usually the logging framework itself
+ continue;
+ }
+ result.append(QStringLiteral("???"));
+ }
+ numberPrinted++;
+ }
+ }
+ return result;
+}
+
+static QString formatBacktraceForLogMessage(const QMessagePattern::BacktraceParams backtraceParams,
+ const char *function)
+{
+ QString backtraceSeparator = backtraceParams.backtraceSeparator;
+ int backtraceDepth = backtraceParams.backtraceDepth;
+
+ QStringList frames = backtraceFramesForLogMessage(backtraceDepth);
+ if (frames.isEmpty())
+ return QString();
+
+ // if the first frame is unknown, replace it with the context function
+ if (function && frames.at(0).startsWith(QLatin1Char('?')))
+ frames[0] = QString::fromUtf8(qCleanupFuncinfo(function));
+
+ return frames.join(backtraceSeparator);
+}
+#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED
+
#if defined(QT_USE_SLOG2)
#ifndef QT_LOG_CODE
#define QT_LOG_CODE 9000
@@ -1336,62 +1420,8 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
#ifdef QLOGGING_HAVE_BACKTRACE
} else if (token == backtraceTokenC) {
QMessagePattern::BacktraceParams backtraceParams = pattern->backtraceArgs.at(backtraceArgsIdx);
- QString backtraceSeparator = backtraceParams.backtraceSeparator;
- int backtraceDepth = backtraceParams.backtraceDepth;
backtraceArgsIdx++;
- QVarLengthArray<void*, 32> buffer(7 + backtraceDepth);
- int n = backtrace(buffer.data(), buffer.size());
- if (n > 0) {
- int numberPrinted = 0;
- for (int i = 0; i < n && numberPrinted < backtraceDepth; ++i) {
- QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
- QString trace = QString::fromLatin1(strings.data()[0]);
- // The results of backtrace_symbols looks like this:
- // /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
- // The offset and function name are optional.
- // This regexp tries to extract the librry name (without the path) and the function name.
- // This code is protected by QMessagePattern::mutex so it is thread safe on all compilers
- static QRegularExpression rx(QStringLiteral("^(?:[^(]*/)?([^(/]+)\\(([^+]*)(?:[\\+[a-f0-9x]*)?\\) \\[[a-f0-9x]*\\]$"),
- QRegularExpression::OptimizeOnFirstUsageOption);
-
- QRegularExpressionMatch m = rx.match(trace);
- if (m.hasMatch()) {
- // skip the trace from QtCore that are because of the qDebug itself
- QString library = m.captured(1);
- QString function = m.captured(2);
- if (!numberPrinted && library.contains(QLatin1String("Qt5Core"))
- && (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive)
- || function.contains(QLatin1String("QDebug")))) {
- continue;
- }
-
- if (function.startsWith(QLatin1String("_Z"))) {
- QScopedPointer<char, QScopedPointerPodDeleter> demangled(
- abi::__cxa_demangle(function.toUtf8(), 0, 0, 0));
- if (demangled)
- function = QString::fromUtf8(qCleanupFuncinfo(demangled.data()));
- }
-
- if (numberPrinted > 0)
- message.append(backtraceSeparator);
-
- if (function.isEmpty()) {
- if (numberPrinted == 0 && context.function)
- message += QString::fromUtf8(qCleanupFuncinfo(context.function));
- else
- message += QLatin1Char('?') + library + QLatin1Char('?');
- } else {
- message += function;
- }
-
- } else {
- if (numberPrinted == 0)
- continue;
- message += backtraceSeparator + QLatin1String("???");
- }
- numberPrinted++;
- }
- }
+ message.append(formatBacktraceForLogMessage(backtraceParams, context.function));
#endif
} else if (token == timeTokenC) {
QString timeFormat = pattern->timeArgs.at(timeArgsIdx);
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 06b0f824f6..edb568a2d6 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -503,7 +503,8 @@ public:
AA_UseStyleSheetPropagationInWidgetStyles = 22, // ### Qt 6: remove me
AA_DontUseNativeDialogs = 23,
AA_SynthesizeMouseForUnhandledTabletEvents = 24,
- AA_DontCheckOpenGLContextThreadAffinity = 25,
+ AA_CompressHighFrequencyEvents = 25,
+ AA_DontCheckOpenGLContextThreadAffinity = 26,
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9878ce046a..d8a0acabf1 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -239,6 +239,17 @@
to mouse events instead. This attribute is enabled
by default. This value has been added in Qt 5.7.
+ \value AA_CompressHighFrequencyEvents Enables compression of certain frequent events.
+ On the X11 windowing system, the default value is true, which means that
+ QEvent::MouseMove, QEvent::TouchUpdate, and changes in window size and
+ position will be combined whenever they occur more frequently than the
+ application handles them, so that they don't accumulate and overwhelm the
+ application later. On other platforms, the default is false.
+ (In the future, the compression feature may be implemented across platforms.)
+ You can test the attribute to see whether compression is enabled.
+ If your application needs to handle all events with no compression,
+ you can unset this attribute. This value has been added in Qt 5.7.
+
\value AA_DontCheckOpenGLContextThreadAffinity When making a context
current using QOpenGLContext, do not check that the
\l{QObject#Thread Affinity}{QObject thread affinity}
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index ee94720e7a..6ecd41bc30 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -107,7 +107,7 @@
# define Q_PROCESSOR_ARM __TARGET_ARCH_ARM
# elif defined(_M_ARM) && _M_ARM > 1
# define Q_PROCESSOR_ARM _M_ARM
-# elif defined(__ARM64_ARCH_8__)
+# elif defined(__ARM64_ARCH_8__) || defined(__aarch64__)
# define Q_PROCESSOR_ARM 8
# elif defined(__ARM_ARCH_7__) \
|| defined(__ARM_ARCH_7A__) \
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index ffa7867d18..0d9fdb3453 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -794,6 +794,17 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
+ \relates QSharedPointer
+ \since 5.7
+
+ Writes the pointer tracked by \a ptr into the debug object \a debug for
+ debugging purposes.
+
+ \sa {Debugging Techniques}
+*/
+
+/*!
\class QDebugStateSaver
\inmodule QtCore
\brief Convenience class for custom QDebug operators
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 5087e3b532..8021f29e16 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -51,6 +51,7 @@
#include <QtCore/qvector.h>
#include <QtCore/qset.h>
#include <QtCore/qcontiguouscache.h>
+#include <QtCore/qsharedpointer.h>
// all these have already been included by various headers above, but don't rely on indirect includes:
#include <vector>
@@ -330,6 +331,14 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
return debug.maybeSpace();
}
+template <class T>
+inline QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace() << "QSharedPointer(" << ptr.data() << ")";
+ return debug;
+}
+
Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value);
template <typename Int>
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index dd71c68edc..8375dc9b1b 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -812,7 +812,9 @@ static bool tryDriveUNCFallback(const QFileSystemEntry &fname, QFileSystemMetaDa
#if !defined(Q_OS_WINRT)
if (fname.isDriveRoot()) {
// a valid drive ??
+ const UINT oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
DWORD drivesBitmask = ::GetLogicalDrives();
+ ::SetErrorMode(oldErrorMode);
int drivebit = 1 << (fname.filePath().at(0).toUpper().unicode() - QLatin1Char('A').unicode());
if (drivesBitmask & drivebit) {
fileAttrib = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM;
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 1e041ab837..70c347978e 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -551,7 +551,9 @@ QFileInfoList QFSFileEngine::drives()
QFileInfoList ret;
#if !defined(Q_OS_WINRT)
# if defined(Q_OS_WIN32)
+ const UINT oldErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
quint32 driveBits = (quint32) GetLogicalDrives() & 0x3ffffff;
+ ::SetErrorMode(oldErrorMode);
# endif
char driveName[] = "A:/";
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index a826bcbd9b..3a9f74bf59 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -108,25 +108,6 @@
QT_BEGIN_NAMESPACE
-static bool isPseudoFs(const QString &mountDir, const QByteArray &type)
-{
- if (mountDir.startsWith(QLatin1String("/dev"))
- || mountDir.startsWith(QLatin1String("/proc"))
- || mountDir.startsWith(QLatin1String("/sys"))
- || mountDir.startsWith(QLatin1String("/var/run"))
- || mountDir.startsWith(QLatin1String("/var/lock"))) {
- return true;
- }
- if (type == "tmpfs")
- return true;
-#if defined(Q_OS_LINUX)
- if (type == "rootfs" || type == "rpc_pipefs")
- return true;
-#endif
-
- return false;
-}
-
class QStorageIterator
{
public:
@@ -164,6 +145,39 @@ private:
#endif
};
+template <typename String>
+static bool isParentOf(const String &parent, const QString &dirName)
+{
+ return dirName.startsWith(parent) &&
+ (dirName.size() == parent.size() || dirName.at(parent.size()) == QLatin1Char('/') ||
+ parent.size() == 1);
+}
+
+static bool isPseudoFs(const QStorageIterator &it)
+{
+ QString mountDir = it.rootPath();
+ if (isParentOf(QLatin1String("/dev"), mountDir)
+ || isParentOf(QLatin1String("/proc"), mountDir)
+ || isParentOf(QLatin1String("/sys"), mountDir)
+ || isParentOf(QLatin1String("/var/run"), mountDir)
+ || isParentOf(QLatin1String("/var/lock"), mountDir)) {
+ return true;
+ }
+
+ QByteArray type = it.fileSystemType();
+ if (type == "tmpfs")
+ return false;
+#if defined(Q_OS_LINUX)
+ if (type == "rootfs" || type == "rpc_pipefs")
+ return true;
+#endif
+
+ if (!it.device().startsWith('/'))
+ return true;
+
+ return false;
+}
+
#if defined(Q_OS_BSD4)
inline QStorageIterator::QStorageIterator()
@@ -450,10 +464,8 @@ void QStorageInfoPrivate::initRootPath()
while (it.next()) {
const QString mountDir = it.rootPath();
const QByteArray fsName = it.fileSystemType();
- if (isPseudoFs(mountDir, fsName))
- continue;
// we try to find most suitable entry
- if (oldRootPath.startsWith(mountDir) && maxLength < mountDir.length()) {
+ if (isParentOf(mountDir, oldRootPath) && maxLength < mountDir.length()) {
maxLength = mountDir.length();
rootPath = mountDir;
device = it.device();
@@ -467,11 +479,14 @@ static inline QString retrieveLabel(const QByteArray &device)
#ifdef Q_OS_LINUX
static const char pathDiskByLabel[] = "/dev/disk/by-label";
+ QFileInfo devinfo(QFile::decodeName(device));
+ QString devicePath = devinfo.canonicalFilePath();
+
QDirIterator it(QLatin1String(pathDiskByLabel), QDir::NoDotAndDotDot);
while (it.hasNext()) {
it.next();
QFileInfo fileInfo(it.fileInfo());
- if (fileInfo.isSymLink() && fileInfo.symLinkTarget().toLocal8Bit() == device)
+ if (fileInfo.isSymLink() && fileInfo.symLinkTarget() == devicePath)
return fileInfo.fileName();
}
#elif defined Q_OS_HAIKU
@@ -542,11 +557,10 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
QList<QStorageInfo> volumes;
while (it.next()) {
- const QString mountDir = it.rootPath();
- const QByteArray fsName = it.fileSystemType();
- if (isPseudoFs(mountDir, fsName))
+ if (isPseudoFs(it))
continue;
+ const QString mountDir = it.rootPath();
volumes.append(QStorageInfo(mountDir));
}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 54afb8a974..d645205155 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -3690,7 +3690,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
\fn QAbstractItemModel::modelAboutToBeReset()
\since 4.2
- This signal is emitted when reset() is called, before the model's internal
+ This signal is emitted when beginResetModel() is called, before the model's internal
state (e.g. persistent model indexes) has been invalidated.
\sa beginResetModel(), modelReset()
@@ -3700,7 +3700,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
\fn QAbstractItemModel::modelReset()
\since 4.1
- This signal is emitted when reset() or endResetModel() is called, after the
+ This signal is emitted when endResetModel() is called, after the
model's internal state (e.g. persistent model indexes) has been invalidated.
Note that if a model is reset it should be considered that all information
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 5feb7a409b..f1d38db96c 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -945,6 +945,26 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
}
}
#endif
+ if (QMetaType::typeFlags(t) & QMetaType::IsEnumeration) {
+ qlonglong value = qConvertToNumber(d, ok);
+ if (*ok) {
+ switch (QMetaType::sizeOf(t)) {
+ case 1:
+ *static_cast<signed char *>(result) = value;
+ return true;
+ case 2:
+ *static_cast<qint16 *>(result) = value;
+ return true;
+ case 4:
+ *static_cast<qint32 *>(result) = value;
+ return true;
+ case 8:
+ *static_cast<qint64 *>(result) = value;
+ return true;
+ }
+ }
+ return *ok;
+ }
return false;
}
return true;
@@ -2819,7 +2839,7 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
/*Int*/ 1 << QVariant::UInt | 1 << QVariant::String | 1 << QVariant::Double
| 1 << QVariant::Bool | 1 << QVariant::LongLong | 1 << QVariant::ULongLong
- | 1 << QVariant::Char | 1 << QVariant::ByteArray,
+ | 1 << QVariant::Char | 1 << QVariant::ByteArray | 1 << QVariant::Int,
/*UInt*/ 1 << QVariant::Int | 1 << QVariant::String | 1 << QVariant::Double
| 1 << QVariant::Bool | 1 << QVariant::LongLong | 1 << QVariant::ULongLong
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index d5b01f3c8a..e3cfd7b988 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1778,7 +1778,11 @@ void QStateMachinePrivate::_q_start()
{
Q_Q(QStateMachine);
Q_ASSERT(state == Starting);
- foreach (QAbstractState *state, configuration) {
+ // iterate over a copy, since we emit signals which may cause
+ // 'configuration' to change, resulting in undefined behavior when
+ // iterating at the same time:
+ const auto config = configuration;
+ for (QAbstractState *state : config) {
QAbstractStatePrivate *abstractStatePrivate = QAbstractStatePrivate::get(state);
abstractStatePrivate->active = false;
emit state->activeChanged(false);
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 5ea8bbe770..447fca44c0 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -232,8 +232,8 @@ public:
AtomicType _q_value;
- Type load() const Q_DECL_NOTHROW { return _q_value; }
- void store(Type newValue) Q_DECL_NOTHROW { _q_value = newValue; }
+ Type load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
+ void store(Type newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
operator Type() const Q_DECL_NOTHROW { return loadAcquire(); }
Type operator=(Type newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; }
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index 89eb3da203..25444ffff6 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -56,6 +56,11 @@
# error "Qt build is broken: qmutex_linux.cpp is being built but futex support is not wanted"
#endif
+#ifndef FUTEX_PRIVATE_FLAG
+# define FUTEX_PRIVATE_FLAG 128
+#endif
+
+
QT_BEGIN_NAMESPACE
/*
@@ -104,40 +109,6 @@ QT_BEGIN_NAMESPACE
static QBasicAtomicInt futexFlagSupport = Q_BASIC_ATOMIC_INITIALIZER(-1);
-static int checkFutexPrivateSupport()
-{
- int value = 0;
-#if defined(FUTEX_PRIVATE_FLAG)
- // check if the kernel supports extra futex flags
- // FUTEX_PRIVATE_FLAG appeared in v2.6.22
- Q_STATIC_ASSERT(FUTEX_PRIVATE_FLAG != 0x80000000);
-
- // try an operation that has no side-effects: wake up 42 threads
- // futex will return -1 (errno==ENOSYS) if the flag isn't supported
- // there should be no other error conditions
- value = syscall(__NR_futex, &futexFlagSupport,
- FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
- 42, 0, 0, 0);
- if (value != -1)
- value = FUTEX_PRIVATE_FLAG;
- else
- value = 0;
-
-#else
- value = 0;
-#endif
- futexFlagSupport.store(value);
- return value;
-}
-
-static inline int futexFlags()
-{
- int value = futexFlagSupport.load();
- if (Q_LIKELY(value != -1))
- return value;
- return checkFutexPrivateSupport();
-}
-
static inline int _q_futex(void *addr, int op, int val, const struct timespec *timeout) Q_DECL_NOTHROW
{
volatile int *int_addr = reinterpret_cast<volatile int *>(addr);
@@ -149,7 +120,7 @@ static inline int _q_futex(void *addr, int op, int val, const struct timespec *t
// we use __NR_futex because some libcs (like Android's bionic) don't
// provide SYS_futex etc.
- return syscall(__NR_futex, int_addr, op | futexFlags(), val, timeout, addr2, val2);
+ return syscall(__NR_futex, int_addr, op | FUTEX_PRIVATE_FLAG, val, timeout, addr2, val2);
}
static inline QMutexData *dummyFutexValue()
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index bf336a8f31..36f1997a6c 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -71,7 +71,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
// Don't allocate empty headers
if (!(options & RawData) && !capacity) {
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (options & Unsharable)
return const_cast<QArrayData *>(&qt_array_unsharable_empty);
#endif
@@ -116,7 +116,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
quintptr data = (quintptr(header) + sizeof(QArrayData) + alignment - 1)
& ~(alignment - 1);
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
header->ref.atomic.store(bool(!(options & Unsharable)));
#else
header->ref.atomic.store(1);
@@ -138,7 +138,7 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
&& !(alignment & (alignment - 1)));
Q_UNUSED(objectSize) Q_UNUSED(alignment)
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (data == &qt_array_unsharable_empty)
return;
#endif
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index 79d0d006ac..5a369baf08 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -78,7 +78,7 @@ struct Q_CORE_EXPORT QArrayData
enum AllocationOption {
CapacityReserved = 0x1,
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Unsharable = 0x2,
#endif
RawData = 0x4,
@@ -255,7 +255,7 @@ struct QTypedArrayData
return allocate(/* capacity */ 0);
}
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
static QTypedArrayData *unsharableEmpty()
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 2036120520..b97dde5a61 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -133,7 +133,7 @@ public:
return (!d->isMutable() || d->ref.isShared());
}
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
void setSharable(bool sharable)
{
if (needsDetach()) {
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index 06b539933e..18facf7e42 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -102,7 +102,7 @@ public:
inline void detach() { if (d->ref.load() != 1) detach_helper(); }
inline bool isDetached() const { return d->ref.load() == 1; }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
#endif
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 8ddf1d9e41..cc8c08d5b1 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -713,7 +713,7 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
QDTPDEBUG << "sectionValue for" << sn.name()
<< "with text" << text << "and st" << sectiontext
- << text.mid(index, sectionmaxsize)
+ << text.midRef(index, sectionmaxsize)
<< index;
int used = 0;
@@ -743,9 +743,8 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
QDTPDEBUGN("This should never happen (findAmPm returned %d)", ampm);
break;
}
- if (state != Invalid) {
- text.replace(index, used, sectiontext.left(used));
- }
+ if (state != Invalid)
+ text.replace(index, used, sectiontext.constData(), used);
break; }
case MonthSection:
case DayOfWeekSectionShort:
@@ -764,7 +763,7 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
if (num != -1) {
state = (used == sectiontext.size() ? Acceptable : Intermediate);
- text.replace(index, used, sectiontext.left(used));
+ text.replace(index, used, sectiontext.constData(), used);
} else {
state = Intermediate;
}
@@ -810,7 +809,7 @@ int QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionInde
}
}
if (ok && tmp <= absMax) {
- QDTPDEBUG << sectiontext.left(digits) << tmp << digits;
+ QDTPDEBUG << sectiontext.leftRef(digits) << tmp << digits;
last = tmp;
used = digits;
break;
@@ -911,7 +910,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
for (int index=0; state != Invalid && index<sectionNodesCount; ++index) {
if (QStringRef(&input, pos, separators.at(index).size()) != separators.at(index)) {
- QDTPDEBUG << "invalid because" << input.mid(pos, separators.at(index).size())
+ QDTPDEBUG << "invalid because" << input.midRef(pos, separators.at(index).size())
<< "!=" << separators.at(index)
<< index << pos << currentSectionIndex;
state = Invalid;
@@ -983,7 +982,7 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
}
if (state != Invalid && QStringRef(&input, pos, input.size() - pos) != separators.last()) {
- QDTPDEBUG << "invalid because" << input.mid(pos)
+ QDTPDEBUG << "invalid because" << input.midRef(pos)
<< "!=" << separators.last() << pos;
state = Invalid;
}
@@ -1384,7 +1383,7 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI
}
if (used)
*used = str.size();
- if (str.trimmed().isEmpty()) {
+ if (QStringRef(&str).trimmed().isEmpty()) {
return PossibleBoth;
}
const QLatin1Char space(' ');
diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp
index e1fc77fb4c..e2c3ae6280 100644
--- a/src/corelib/tools/qelapsedtimer_unix.cpp
+++ b/src/corelib/tools/qelapsedtimer_unix.cpp
@@ -38,9 +38,6 @@
**
****************************************************************************/
-// ask for the latest POSIX, just in case
-#define _POSIX_C_SOURCE 200809L
-
#include "qelapsedtimer.h"
#if defined(Q_OS_VXWORKS)
#include "qfunctions_vxworks.h"
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index b15dc7b07b..7abbeabeae 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -272,7 +272,7 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; }
#endif
bool isSharedWith(const QHash &other) const { return d == other.d; }
@@ -1092,9 +1092,6 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::count(const Key &key, const T &value)
return n;
}
-Q_CORE_EXPORT int qGlobalQHashSeed();
-Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
-
Q_DECLARE_ASSOCIATIVE_ITERATOR(Hash)
Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash)
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
index b6cb84ee15..0eb6c1b5ce 100644
--- a/src/corelib/tools/qhashfunctions.h
+++ b/src/corelib/tools/qhashfunctions.h
@@ -64,6 +64,9 @@ class QString;
class QStringRef;
class QLatin1String;
+Q_CORE_EXPORT int qGlobalQHashSeed();
+Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
+
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW;
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 3e0de52da6..e3eed9184f 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -105,7 +105,7 @@ public:
inline void detach()
{ if (d->ref.isShared()) detach_helper2(this->e); }
inline bool isDetached() const { return !d->ref.isShared(); }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QLinkedListData::shared_null) d->sharable = sharable; }
#endif
inline bool isSharedWith(const QLinkedList<T> &other) const { return d == other.d; }
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 81f8f8ec05..c7f27abdd6 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -178,7 +178,7 @@ public:
}
inline bool isDetached() const { return !d->ref.isShared(); }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index f84d733db0..baa10b7a95 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -365,7 +365,7 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h
index 77f06c8077..9586c3a79a 100644
--- a/src/corelib/tools/qrefcount.h
+++ b/src/corelib/tools/qrefcount.h
@@ -53,7 +53,7 @@ class RefCount
public:
inline bool ref() Q_DECL_NOTHROW {
int count = atomic.load();
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
#endif
@@ -64,7 +64,7 @@ public:
inline bool deref() Q_DECL_NOTHROW {
int count = atomic.load();
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
#endif
@@ -73,7 +73,7 @@ public:
return atomic.deref();
}
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
bool setSharable(bool sharable) Q_DECL_NOTHROW
{
Q_ASSERT(!isShared());
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index 088403f09d..08b38a08c2 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -85,7 +85,7 @@ public:
inline void detach() { q_hash.detach(); }
inline bool isDetached() const { return q_hash.isDetached(); }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
#endif
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index c369ff8697..939a1bdffd 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -1323,17 +1323,6 @@
compile. Use qSharedPointerConstCast to cast away the constness.
*/
-/*!
- \fn QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
- \relates QSharedPointer
- \since 5.7
-
- Writes the pointer tracked by \a ptr into the debug object \a debug for
- debugging purposes.
-
- \sa {Debugging Techniques}
-*/
-
#include <qset.h>
#include <qmutex.h>
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index 3e05bf1ece..6b38f0e80c 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -161,8 +161,6 @@ template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(const QWe
template <class X, class T> QWeakPointer<X> qWeakPointerCast(const QWeakPointer<T> &src);
-template <class T> QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr);
-
QT_END_NAMESPACE
#endif // Q_QDOC
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index bbac2d0327..d051ed6099 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -62,7 +62,6 @@ QT_END_NAMESPACE
#include <new>
#include <QtCore/qatomic.h>
#include <QtCore/qobject.h> // for qobject_cast
-#include <QtCore/qdebug.h>
#if QT_DEPRECATED_SINCE(5, 6)
#include <QtCore/qhash.h>
#endif
@@ -883,16 +882,6 @@ inline void qSwap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
p1.swap(p2);
}
-#ifndef QT_NO_DEBUG_STREAM
-template <class T>
-Q_INLINE_TEMPLATE QDebug operator<<(QDebug debug, const QSharedPointer<T> &ptr)
-{
- QDebugStateSaver saver(debug);
- debug.nospace() << "QSharedPointer(" << ptr.data() << ")";
- return debug;
-}
-#endif
-
QT_END_NAMESPACE
namespace std {
template <class T>
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 698189f9c6..7b1d94c501 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -670,7 +670,11 @@ void qDetectCpuFeatures()
// contains all the features that the code required. Qt 4 ran for years
// like that, so it shouldn't be a problem.
- qt_cpu_features.store(minFeature | quint32(QSimdInitialized));
+ qt_cpu_features[0].store(minFeature | quint32(QSimdInitialized));
+#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
+ qt_cpu_features[1].store(minFeature >> 32);
+#endif
+
return;
# endif
#endif
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 557bec9676..fea50f4c34 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -106,7 +106,7 @@ public:
inline void detach();
inline bool isDetached() const { return !d->ref.isShared(); }
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@@ -382,7 +382,7 @@ template <typename T>
void QVector<T>::detach()
{
if (!isDetached()) {
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (!d->alloc)
d = Data::unsharableEmpty();
else
@@ -539,7 +539,7 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
x = Data::allocate(aalloc, options);
Q_CHECK_PTR(x);
// aalloc is bigger then 0 so it is not [un]sharedEmpty
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Q_ASSERT(x->ref.isSharable() || options.testFlag(QArrayData::Unsharable));
#endif
Q_ASSERT(!x->ref.isStatic());
@@ -607,7 +607,7 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
Q_ASSERT(d->data());
Q_ASSERT(uint(d->size) <= d->alloc);
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Q_ASSERT(d != Data::unsharableEmpty());
#endif
Q_ASSERT(aalloc ? d != Data::sharedNull() : d == Data::sharedNull());
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index de86a60616..4d77f4e43f 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -152,6 +152,7 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, system-zlib) {
include($$PWD/../../3rdparty/zlib_dependency.pri)
} else {
+ CONFIG += no_core_dep
include($$PWD/../../3rdparty/zlib.pri)
}