diff options
-rw-r--r-- | src/corelib/tools/qcollator.cpp | 39 | ||||
-rw-r--r-- | src/corelib/tools/qcollator.h (renamed from src/corelib/tools/qcollator_p.h) | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/tools.pri | 2 |
4 files changed, 26 insertions, 19 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index a22d41838c..f41e9d61bf 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qcollator_p.h" +#include "qcollator.h" #include "qstringlist.h" #include "qstring.h" @@ -117,7 +117,7 @@ static const char * const collationStrings[collationStringsCount] = { \inmodule QtCore \brief The QCollator class compares strings according to a localized collation algorithm. - \internal + \since 5.2 \reentrant \ingroup i18n @@ -133,6 +133,8 @@ static const char * const collationStrings[collationStringsCount] = { In addition to the locale and collation strategy, several optional flags can be set that influence the result of the collation. + + QCollator currently depends on Qt being compiled with ICU support enabled. */ /*! @@ -140,7 +142,7 @@ static const char * const collationStrings[collationStringsCount] = { specified the default collation algorithm for the locale is being used. If \a locale is not specified QLocale::default() is being used. - \sa setLocale, setCollation, setOptions + \sa setLocale(), setCollation() */ QCollator::QCollator(const QLocale &locale, QCollator::Collation collation) : d(new QCollatorPrivate) @@ -221,7 +223,6 @@ void QCollator::detach() } } - /*! Sets the locale of the collator to \a locale. */ @@ -253,6 +254,7 @@ QLocale QCollator::locale() const \value Default Use the default algorithm for the locale \value Big5Han + \value Dictionary \value Direct \value GB2312Han \value PhoneBook @@ -266,7 +268,7 @@ QLocale QCollator::locale() const */ /*! - Sets the collation algorithm to be used. + Sets the \a collation algorithm to be used. \sa QCollator::Collation */ @@ -298,7 +300,7 @@ QCollator::Collation QCollator::collation() const This method is helpful to save and restore defined collation objects. - \sa fromIdentifier + \sa fromIdentifier() */ QString QCollator::identifier() const { @@ -313,9 +315,9 @@ QString QCollator::identifier() const } /*! - Creates a QCollator from a unique identifier and returns it. + Creates a QCollator from a unique \a identifier and returns it. - \sa identifier + \sa identifier() */ QCollator QCollator::fromIdentifier(const QString &identifier) { @@ -351,20 +353,20 @@ QCollator QCollator::fromIdentifier(const QString &identifier) */ /*! - Sets the case preference of the collator. + Sets the case \a preference of the collator. \sa QCollator::CasePreference */ -void QCollator::setCasePreference(CasePreference c) +void QCollator::setCasePreference(CasePreference preference) { if (d->ref.load() != 1) detach(); #ifdef QT_USE_ICU UColAttributeValue val = UCOL_OFF; - if (c == QCollator::CasePreferenceUpper) + if (preference == QCollator::CasePreferenceUpper) val = UCOL_UPPER_FIRST; - else if (c == QCollator::CasePreferenceLower) + else if (preference == QCollator::CasePreferenceLower) val = UCOL_LOWER_FIRST; UErrorCode status = U_ZERO_ERROR; @@ -372,7 +374,7 @@ void QCollator::setCasePreference(CasePreference c) if (U_FAILURE(status)) qWarning("ucol_setAttribute: Case First failed: %d", status); #else - Q_UNUSED(c); + Q_UNUSED(preference); #endif } @@ -423,7 +425,7 @@ void QCollator::setNumericMode(bool on) /*! Returns true if numeric sorting is enabled, false otherwise. - \sa setNumericMode + \sa setNumericMode() */ bool QCollator::numericMode() const { @@ -436,7 +438,7 @@ bool QCollator::numericMode() const } /*! - If set to true, punctuation characters and symbols are ignored when determining sort order. + If \a on is set to true, punctuation characters and symbols are ignored when determining sort order. The default is locale dependent. */ @@ -458,7 +460,7 @@ void QCollator::setIgnorePunctuation(bool on) /*! Returns true if punctuation characters and symbols are ignored when determining sort order. - \sa setIgnorePunctuation + \sa setIgnorePunctuation() */ bool QCollator::ignorePunctuation() const { @@ -584,4 +586,9 @@ QStringList QCollator::indexCharacters() const return d->indexCharacters; } +/*! + \fn bool QCollator::operator()(const QString &s1, const QString &s2) const + \internal +*/ + QT_END_NAMESPACE diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator.h index 51de205565..02470c331f 100644 --- a/src/corelib/tools/qcollator_p.h +++ b/src/corelib/tools/qcollator.h @@ -89,7 +89,7 @@ public: }; CasePreference casePreference() const; - void setCasePreference(CasePreference c); + void setCasePreference(CasePreference preference); void setNumericMode(bool on); bool numericMode() const; diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index b9b261e27c..48d96e0ed0 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -59,7 +59,7 @@ #include "qhash.h" #include "qdebug.h" #include "qendian.h" -#include "qcollator_p.h" +#include "qcollator.h" #ifdef Q_OS_MAC #include <private/qcore_mac_p.h> diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 2f3697acb8..d3f87977fc 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -11,9 +11,9 @@ HEADERS += \ tools/qbytedata_p.h \ tools/qcache.h \ tools/qchar.h \ - tools/qcollator_p.h \ tools/qcommandlineoption.h \ tools/qcommandlineparser.h \ + tools/qcollator.h \ tools/qcontainerfwd.h \ tools/qcryptographichash.h \ tools/qdatetime.h \ |