Tree Items¶
Custom tree widget items with enhanced functionality.
Preview
FXSortedTreeWidgetItem
¶
Bases:
Custom QTreeWidgetItem that provides natural sorting for strings
containing numbers. This is useful for sorting items like version numbers
or other strings where numeric parts should be ordered numerically.
For example, this class will sort the following strings in the correct human-friendly order:
- "something1"
- "something9"
- "something17"
- "something25"
Instead of the default sorting order:
- "something1"
- "something17"
- "something25"
- "something9"
Methods:
| Name | Description |
|---|---|
|
Override the less-than operator to provide a custom sorting logic. |
__lt__
¶
Override the less-than operator to provide a custom sorting logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
Another instance of |
required |
Returns:
| Type | Description |
|---|---|
|
|
|
the natural sort order, |