summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qcollator.cpp13
-rw-r--r--src/corelib/tools/qcollator_posix.cpp3
-rw-r--r--src/corelib/tools/qunicodetables.cpp2
-rw-r--r--src/corelib/tools/qunicodetables_p.h4
-rw-r--r--src/corelib/tools/qvarlengtharray.h20
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc11
-rw-r--r--src/corelib/tools/qvector.cpp2
-rw-r--r--src/corelib/tools/tools.pri23
8 files changed, 42 insertions, 36 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index f86318c9c9..9148ecf6fc 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -275,8 +275,8 @@ bool QCollator::ignorePunctuation() const
/*!
\fn int QCollator::compare(const QString &s1, const QString &s2) const
- Compares \a s1 with \a s2. Returns -1, 0 or 1 depending on whether \a s1 is
- smaller, equal or larger than \a s2.
+ Compares \a s1 with \a s2. Returns an integer less than, equal to, or greater than zero
+ depending on whether \a s1 is smaller, equal or larger than \a s2.
*/
/*!
@@ -288,8 +288,8 @@ bool QCollator::ignorePunctuation() const
\fn int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
\overload
- Compares \a s1 with \a s2. Returns -1, 0 or 1 depending on whether \a s1 is
- smaller, equal or larger than \a s2.
+ Compares \a s1 with \a s2. Returns an integer less than, equal to, or greater than zero
+ depending on whether \a s1 is smaller, equal or larger than \a s2.
*/
/*!
@@ -299,8 +299,9 @@ bool QCollator::ignorePunctuation() const
Compares \a s1 with \a s2. \a len1 and \a len2 specify the length of the
QChar arrays pointer to by \a s1 and \a s2.
- Returns -1, 0 or 1 depending on whether \a s1 is smaller, equal or larger than \a s2.
- */
+ Returns an integer less than, equal to, or greater than zero
+ depending on whether \a s1 is smaller, equal or larger than \a s2.
+*/
/*!
\fn QCollatorSortKey QCollator::sortKey(const QString &string) const
diff --git a/src/corelib/tools/qcollator_posix.cpp b/src/corelib/tools/qcollator_posix.cpp
index 0b755825b7..352ab0ba31 100644
--- a/src/corelib/tools/qcollator_posix.cpp
+++ b/src/corelib/tools/qcollator_posix.cpp
@@ -78,8 +78,7 @@ int QCollator::compare(const QString &s1, const QString &s2) const
QVarLengthArray<wchar_t> array1, array2;
stringToWCharArray(array1, s1);
stringToWCharArray(array2, s2);
- int result = std::wcscoll(array1.constData(), array2.constData());
- return result > 0 ? 1 : (result == 0 ? 0 : -1);
+ return std::wcscoll(array1.constData(), array2.constData());
}
int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 6a09abd80f..5f7eee947f 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -31,7 +31,7 @@
**
****************************************************************************/
-/* This file is autogenerated from the Unicode 6.2 database. Do not edit */
+/* This file is autogenerated from the Unicode 6.3 database. Do not edit */
#include "qunicodetables_p.h"
diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h
index 4199724993..90340bb360 100644
--- a/src/corelib/tools/qunicodetables_p.h
+++ b/src/corelib/tools/qunicodetables_p.h
@@ -31,7 +31,7 @@
**
****************************************************************************/
-/* This file is autogenerated from the Unicode 6.2 database. Do not edit */
+/* This file is autogenerated from the Unicode 6.3 database. Do not edit */
//
// W A R N I N G
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-#define UNICODE_DATA_VERSION QChar::Unicode_6_2
+#define UNICODE_DATA_VERSION QChar::Unicode_6_3
namespace QUnicodeTables {
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 54d97d8762..95cd0447d8 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -42,6 +42,9 @@
#include <string.h>
#include <stdlib.h>
#include <algorithm>
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+#include <initializer_list>
+#endif
QT_BEGIN_NAMESPACE
@@ -62,6 +65,14 @@ public:
append(other.constData(), other.size());
}
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+ QVarLengthArray(std::initializer_list<T> args)
+ : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
+ {
+ append(args.begin(), args.size());
+ }
+#endif
+
inline ~QVarLengthArray() {
if (QTypeInfo<T>::isComplex) {
T *i = ptr + s;
@@ -457,11 +468,10 @@ bool operator==(const QVarLengthArray<T, Prealloc1> &l, const QVarLengthArray<T,
{
if (l.size() != r.size())
return false;
- for (int i = 0; i < l.size(); i++) {
- if (l.at(i) != r.at(i))
- return false;
- }
- return true;
+ const T *rb = r.begin();
+ const T *b = l.begin();
+ const T *e = l.end();
+ return std::equal(b, e, rb);
}
template <typename T, int Prealloc1, int Prealloc2>
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 6cc9f62c5a..d1b87f381e 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -100,6 +100,17 @@
\l{default-constructed value}.
*/
+
+/*! \fn QVarLengthArray::QVarLengthArray(std::initializer_list<T> args)
+ \since 5.5
+
+ Constructs an array from the std::initializer_list given by \a args.
+
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
+*/
+
+
/*! \fn QVarLengthArray::~QVarLengthArray()
Destroys the array.
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 1bfca44155..d10f82fbb4 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -229,7 +229,7 @@
/*! \fn QVector::QVector(std::initializer_list<T> args)
\since 4.8
- Construct a vector from the std::initilizer_list given by \a args.
+ Constructs a vector from the std::initializer_list given by \a args.
This constructor is only enabled if the compiler supports C++11 initializer
lists.
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index c4c347d6ff..5de0c09a4d 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -161,23 +161,12 @@ contains(QT_CONFIG, zlib) {
}
contains(QT_CONFIG,icu) {
+ include($$PWD/../../3rdparty/icu_dependency.pri)
+
SOURCES += tools/qlocale_icu.cpp \
tools/qcollator_icu.cpp \
tools/qtimezoneprivate_icu.cpp
DEFINES += QT_USE_ICU
- win32 {
- CONFIG(static, static|shared) {
- CONFIG(debug, debug|release) {
- LIBS_PRIVATE += -lsicuind -lsicuucd -lsicudtd
- } else {
- LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt
- }
- } else {
- LIBS_PRIVATE += -licuin -licuuc -licudt
- }
- } else {
- LIBS_PRIVATE += -licui18n -licuuc -licudata
- }
} else: win32 {
SOURCES += tools/qcollator_win.cpp
} else: macx {
@@ -187,14 +176,10 @@ contains(QT_CONFIG,icu) {
}
!contains(QT_DISABLED_FEATURES, regularexpression) {
+ include($$PWD/../../3rdparty/pcre_dependency.pri)
+
HEADERS += tools/qregularexpression.h
SOURCES += tools/qregularexpression.cpp
-
- pcre {
- include($$PWD/../../3rdparty/pcre.pri)
- } else {
- LIBS_PRIVATE += -lpcre16
- }
}
INCLUDEPATH += ../3rdparty/harfbuzz/src