Skip to content

PythonQt.QtCore.QCollator

QCollator

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

QCollator is initialized with a QLocale and an optional collation strategy. It tries to initialize the collator with the specified values. The collator can then be used to compare and sort strings in a locale dependent fashion.

A QCollator object can be used together with template based sorting algorithms such as std::sort to sort a list of QStrings.

In addition to the locale and collation strategy, several optional flags can be set that influence the result of the collation.

Source: https://doc.qt.io/archives/qt-5.15/qcollator.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
caseSensitivity function (self) -> Any Returns case sensitivity of the collator.
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
compare function (self, s1: str, len1: Any, s2: str, len2: Any) -> int X.compare(s1, len1, s2, len2) -> int
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
ignorePunctuation function (self) -> bool X.ignorePunctuation() -> bool
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
locale function (self) -> Any X.locale() -> PythonQt.QtCore.QLocale
numericMode function (self) -> bool X.numericMode() -> bool
operator_assign function (self, arg__1: Any) -> Any X.operator_assign(arg__1) -> PythonQt.QtCore.QCollator
operator_cast_ function (self, s1: Any, s2: Any) -> bool X.operator_cast_(s1, s2) -> bool
setCaseSensitivity function (self, cs: Any) -> None Sets the case sensitivity of the collator.
setIgnorePunctuation function (self, on: bool) -> None If on is set to true, punctuation characters and symbols are ignored when determining sort order.
setLocale function (self, locale: Any) -> None Sets the locale of the collator to locale.
setNumericMode function (self, on: bool) -> None Enables numeric sorting mode when on is set to true.
sortKey function (self, string: str) -> Any X.sortKey(string) -> PythonQt.QtCore.QCollatorSortKey
swap function (self, other: Any) -> None Swaps this collator with other.