summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-06 01:00:33 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-06 01:00:33 +0200
commite5d028941339bbc5f5eaa2dfa5a2bb8d17353f24 (patch)
tree3d91bf1dbe6728d8c6f85dd46b5aff67e83d9ae6 /src/corelib
parent40cd0f35ef0b27b1451caf393a97b8a4ac8cd4b2 (diff)
parent028727c20ca43f1a56bad010354837e238e30024 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp1
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h7
-rw-r--r--src/corelib/kernel/qtimer.cpp10
-rw-r--r--src/corelib/kernel/qtimer.h8
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp2
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp13
-rw-r--r--src/corelib/tools/qstring.h9
-rw-r--r--src/corelib/tools/qstringlist.cpp14
-rw-r--r--src/corelib/tools/qstringlist.h12
10 files changed, 62 insertions, 16 deletions
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 6b59b0723b..31b9bbc990 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -43,7 +43,6 @@
#include <qdebug.h>
#include <qdatetime.h>
#include <qpair.h>
-#include <qregularexpression.h>
#include <qstringlist.h>
#include <private/qabstractitemmodel_p.h>
#include <private/qabstractproxymodel_p.h>
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h
index 0b7c69f37d..1304a95d13 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.h
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.h
@@ -42,7 +42,10 @@
#include <QtCore/qabstractproxymodel.h>
#include <QtCore/qregexp.h>
-#include <QtCore/qregularexpression.h>
+
+#if QT_CONFIG(regularexpression)
+# include <QtCore/qregularexpression.h>
+#endif
QT_REQUIRE_CONFIG(sortfilterproxymodel);
@@ -87,8 +90,10 @@ public:
QRegExp filterRegExp() const;
void setFilterRegExp(const QRegExp &regExp);
+#if QT_CONFIG(regularexpression)
QRegularExpression filterRegularExpression() const;
void setFilterRegularExpression(const QRegularExpression &regularExpression);
+#endif
int filterKeyColumn() const;
void setFilterKeyColumn(int column);
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index d8d520ff58..90f29aa630 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -571,7 +571,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
- \fn template<typename Functor> QMetaObject::Connection connectTo(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template<typename Functor> QMetaObject::Connection callOnTimeout(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload
@@ -585,9 +585,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
- \fn template<typename Functor> QMetaObject::Connection connectTo(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template<typename Functor> QMetaObject::Connection callOnTimeout(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
- \overload connectTo()
+ \overload callOnTimeout()
Creates a connection from the timeout() signal to \a functor to be placed in a specific
event loop of \a context, and returns a handle to the connection.
@@ -599,9 +599,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
- \fn template<typename PointerToMemberFunction> QMetaObject::Connection connectTo(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template<typename PointerToMemberFunction> QMetaObject::Connection callOnTimeout(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
- \overload connectTo()
+ \overload callOnTimeout()
Creates a connection from the timeout() signal to the \a method in the \a receiver object. Returns
a handle to the connection.
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index f5c04c7f70..66f317c567 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -97,11 +97,11 @@ public:
template<typename Functor, int>
static void singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor functor);
template <typename Functor>
- QMetaObject::Connection connectTo(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename Functor>
- QMetaObject::Connection connectTo(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename PointerToMemberFunction>
- QMetaObject::Connection connectTo(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
#else
// singleShot to a QObject slot
template <typename Duration, typename Func1>
@@ -160,7 +160,7 @@ public:
}
template <typename ... Args>
- QMetaObject::Connection connectTo(Args && ...args)
+ QMetaObject::Connection callOnTimeout(Args && ...args)
{
return QObject::connect(this, &QTimer::timeout, std::forward<Args>(args)... );
}
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 851b9ff82f..e03814984c 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -157,7 +157,7 @@ bool QLibraryPrivate::load_sys()
// Do not unload the library during dlclose(). Consequently, the
// library's specific static variables are not reinitialized if the
// library is reloaded with dlopen() at a later time.
-#ifdef RTLD_NODELETE
+#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID)
if (loadHints & QLibrary::PreventUnloadHint) {
dlFlags |= RTLD_NODELETE;
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d8aadaa744..1e591d6d69 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -432,7 +432,7 @@ int qstricmp(const char *str1, const char *str2)
return int(Incomplete);
};
-#ifdef __SSE4_1__
+#if defined(__SSE4_1__) && !(defined(__SANITIZE_ADDRESS__) || QT_HAS_FEATURE(address_sanitizer))
enum { PageSize = 4096, PageMask = PageSize - 1 };
const __m128i zero = _mm_setzero_si128();
forever {
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 6030d7058c..b3ed62982e 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -6225,7 +6225,17 @@ QString& QString::fill(QChar ch, int size)
sensitivity setting \a cs.
*/
+/*!
+ \fn int QString::compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+
+ \since 5.12
+ \overload compare()
+ Performs a comparison of this with \a s, using the case
+ sensitivity setting \a cs.
+*/
+
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\overload compare()
\since 4.2
@@ -6241,6 +6251,7 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_
{
return qt_compare_strings(*this, other, cs);
}
+#endif
/*!
\internal
@@ -6267,6 +6278,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N
return qt_compare_strings(*this, other, cs);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn int QString::compare(const QStringRef &ref, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\overload compare()
@@ -6275,6 +6287,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N
an integer less than, equal to, or greater than zero if the string
is less than, equal to, or greater than \a ref.
*/
+#endif
/*!
\internal
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 77b562ec5b..da76601e88 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -608,8 +608,12 @@ public:
QString &setUnicode(const QChar *unicode, int size);
inline QString &setUtf16(const ushort *utf16, int size);
+#if QT_STRINGVIEW_LEVEL < 2
int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+#endif
int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
static inline int compare(const QString &s1, const QString &s2,
Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
@@ -622,7 +626,6 @@ public:
Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
{ return -s2.compare(s1, cs); }
- inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
static int compare(const QString &s1, const QStringRef &s2,
Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
@@ -1636,8 +1639,12 @@ inline bool operator> (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW
inline bool operator<=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs >= lhs; }
inline bool operator>=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs <= lhs; }
+#if QT_STRINGVIEW_LEVEL < 2
inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
+#endif
+inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+{ return -s.compare(*this, cs); }
inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 712ba74716..c85a4f41dd 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -323,6 +323,7 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt:
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
@@ -332,7 +333,18 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt:
\sa indexOf(), lastIndexOf(), QString::contains()
*/
-bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str,
+#endif
+
+/*!
+ \fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
+ \overload
+ \since 5.12
+
+ Returns \c true if the list contains the string \a str; otherwise
+ returns \c false. The search is case insensitive if \a cs is
+ Qt::CaseInsensitive; the search is case sensitive by default.
+ */
+bool QtPrivate::QStringList_contains(const QStringList *that, QStringView str,
Qt::CaseSensitivity cs)
{
return stringList_contains(*that, str, cs);
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index e58445b8c0..b04b7c0bc8 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -117,8 +117,11 @@ public:
{ QList<QString>::operator=(std::move(other)); return *this; }
#endif
+#if QT_STRINGVIEW_LEVEL < 2
inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline QStringList operator+(const QStringList &other) const
{ QStringList n = *this; n += other; return n; }
@@ -161,7 +164,7 @@ namespace QtPrivate {
QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs);
- bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
+ bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs);
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
Qt::CaseSensitivity cs);
@@ -213,16 +216,23 @@ inline QStringList QListSpecialMethods<QString>::filter(const QString &str, Qt::
return QtPrivate::QStringList_filter(self(), str, cs);
}
+#if QT_STRINGVIEW_LEVEL < 2
inline bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
{
return QtPrivate::QStringList_contains(this, str, cs);
}
+#endif
inline bool QStringList::contains(QLatin1String str, Qt::CaseSensitivity cs) const
{
return QtPrivate::QStringList_contains(this, str, cs);
}
+inline bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
+{
+ return QtPrivate::QStringList_contains(this, str, cs);
+}
+
inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
{
QtPrivate::QStringList_replaceInStrings(self(), before, after, cs);