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.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 63ffae4e2b..d2bb752c6d 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -89,6 +89,8 @@ Q_GLOBAL_STATIC(QLocalePrivate, globalLocalePrivate)
#ifdef QT_USE_ICU
extern bool qt_initIcu(const QString &localeName);
+extern bool qt_u_strToUpper(const QString &str, QString *out, const QLocale &locale);
+extern bool qt_u_strToLower(const QString &str, QString *out, const QLocale &locale);
#endif
/******************************************************************************
@@ -2171,6 +2173,42 @@ Qt::LayoutDirection QLocale::textDirection() const
return Qt::LeftToRight;
}
+/*!
+ \since 4.8
+
+ Returns an uppercase copy of \a str.
+*/
+QString QLocale::toUpper(const QString &str) const
+{
+#ifdef QT_USE_ICU
+ {
+ QString result;
+ if (qt_u_strToUpper(str, &result, *this))
+ return result;
+ // else fall through and use Qt's toUpper
+ }
+#endif
+ return str.toUpper();
+}
+
+/*!
+ \since 4.8
+
+ Returns a lowercase copy of \a str.
+*/
+QString QLocale::toLower(const QString &str) const
+{
+#ifdef QT_USE_ICU
+ {
+ QString result;
+ if (qt_u_strToLower(str, &result, *this))
+ return result;
+ // else fall through and use Qt's toUpper
+ }
+#endif
+ return str.toLower();
+}
+
/*!
\since 4.5