summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-07-21 05:17:52 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-07-21 05:17:52 (GMT)
commit86e5445e210f812e3f3059e175cce323c68ac216 (patch)
tree2240113800482faa397eee49c1b3c6577e11880a /src/corelib
parentee0a68022a37422c58af95f418e385032ee4fea6 (diff)
parentb930e258a14b851360d08be373c28f912d2242b0 (diff)
downloadQt-86e5445e210f812e3f3059e175cce323c68ac216.zip
Qt-86e5445e210f812e3f3059e175cce323c68ac216.tar.gz
Qt-86e5445e210f812e3f3059e175cce323c68ac216.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Move separator skipping to proper place Skip shaping for hidden line/paragraph separators Support interface orientation for uikit. Add support for opening LinuxInput devices exclusively ('grabbing'). Fixed regression in compilerwarnings. Properly quit the input event thread in the directfb platform plugin. Apply 57993ba7 properly to 4.8 Deprecate some QPixmap functions (marked as obsolete already). Deprecate some functions in QImage (that have been obsolete since 4.1). Add QLocale::toUpper/Lower Fix warning for uninitialized variable
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qlocale.cpp38
-rw-r--r--src/corelib/tools/qlocale.h3
-rw-r--r--src/corelib/tools/qstring.cpp30
3 files changed, 49 insertions, 22 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index d791529..8640c8b 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -88,6 +88,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
/******************************************************************************
@@ -2180,6 +2182,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
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 8a5d526..55dd55b 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -724,6 +724,9 @@ public:
Qt::LayoutDirection textDirection() const;
+ QString toUpper(const QString &str) const;
+ QString toLower(const QString &str) const;
+
QString currencySymbol(CurrencySymbolFormat = CurrencySymbol) const;
QString toCurrencyString(qlonglong, const QString &symbol = QString()) const;
QString toCurrencyString(qulonglong, const QString &symbol = QString()) const;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 791bfff..f5efe55 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -109,8 +109,6 @@ static QHash<void *, QByteArray> *asciiCache = 0;
#ifdef QT_USE_ICU
// qlocale_icu.cpp
extern bool qt_ucol_strcoll(const QChar *source, int sourceLength, const QChar *target, int targetLength, int *result);
-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
@@ -5015,7 +5013,10 @@ QString QString::rightJustified(int width, QChar fill, bool truncate) const
\snippet doc/src/snippets/qstring/main.cpp 75
- \sa toUpper()
+ The case conversion will always happen in the 'C' locale. For locale dependent
+ case folding use QLocale::toLower()
+
+ \sa toUpper(), QLocale::toLower()
*/
QString QString::toLower() const
@@ -5026,15 +5027,6 @@ QString QString::toLower() const
if (!d->size)
return *this;
-#ifdef QT_USE_ICU
- {
- QString result;
- if (qt_u_strToLower(*this, &result, QLocale()))
- return result;
- // else fall through and use Qt's toUpper
- }
-#endif
-
const ushort *e = d->data + d->size;
// this avoids one out of bounds check in the loop
@@ -5115,7 +5107,10 @@ QString QString::toCaseFolded() const
\snippet doc/src/snippets/qstring/main.cpp 81
- \sa toLower()
+ The case conversion will always happen in the 'C' locale. For locale dependent
+ case folding use QLocale::toUpper()
+
+ \sa toLower(), QLocale::toLower()
*/
QString QString::toUpper() const
@@ -5126,15 +5121,6 @@ QString QString::toUpper() const
if (!d->size)
return *this;
-#ifdef QT_USE_ICU
- {
- QString result;
- if (qt_u_strToUpper(*this, &result, QLocale()))
- return result;
- // else fall through and use Qt's toUpper
- }
-#endif
-
const ushort *e = d->data + d->size;
// this avoids one out of bounds check in the loop