PySide6.QtCore.QCollatorSortKey¶
- class QCollatorSortKey¶
- The - QCollatorSortKeyclass can be used to speed up string collation. More…- Synopsis¶- Methods¶- def - __init__()
- def - compare()
- def - __lt__()
- def - swap()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- The - QCollatorSortKeyclass is always created by- sortKey()and is used for fast strings collation, for example when collating many strings.- __init__(other)¶
- Parameters:
- other – - QCollatorSortKey
 
 - Constructs a copy of the - othercollator key.- compare(key)¶
- Parameters:
- key – - QCollatorSortKey
- Return type:
- int 
 
 - Compares this key to - otherKey, which must have been created by the same- QCollator‘s sortKey() as this key. The comparison is performed in accordance with that- QCollator‘s sort order.- Returns a negative value if this key sorts before - otherKey, 0 if the two keys are equal or a positive value if this key sorts after- otherKey.- See also - operator- __lt__(rhs)¶
- Parameters:
- rhs – - QCollatorSortKey
- Return type:
- bool 
 
 - Both keys must have been created by the same - QCollator‘s sortKey(). Returns- trueif- lhsshould be sorted before- rhs, according to the- QCollatorthat created them; otherwise returns- false.- See also - swap(other)¶
- Parameters:
- other – - QCollatorSortKey
 
 - Swaps this collator key with - other. This operation is very fast and never fails.