summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r--src/corelib/tools/qlocale.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 824b70c3fd..703341cc36 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -42,6 +42,7 @@
#include "qdatastream.h"
#include "qdebug.h"
+#include "qhashfunctions.h"
#include "qstring.h"
#include "qlocale.h"
#include "qlocale_p.h"
@@ -420,7 +421,7 @@ bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QSt
state = ScriptState;
break;
case ScriptState: {
- QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list));
+ QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list) - 1);
if (value.length() == 4 && scripts.indexOf(value) % 4 == 0) {
// script name is always 4 characters
script = value;
@@ -866,6 +867,21 @@ bool QLocale::operator!=(const QLocale &other) const
}
/*!
+ \since 5.6
+ \relates QLocale
+
+ Returns the hash value for \a key, using
+ \a seed to seed the calculation.
+*/
+uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW
+{
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.d->m_data);
+ seed = hash(seed, key.d->m_numberOptions);
+ return seed;
+}
+
+/*!
\since 4.2
Sets the \a options related to number conversions for this