KDECore
KSortableList< T, Key > Class Template Reference
#include <KSortableList>
Inheritance diagram for KSortableList< T, Key >:

Detailed Description
template<typename T, typename Key = int>
class KSortableList< T, Key >
KSortableList is a QList which associates a key with each item in the list.
This key is used for sorting when calling sort().
This allows to temporarily calculate a key and use it for sorting, without having to store that key in the items, or calculate that key many times for the same item during sorting if that calculation is expensive.
Definition at line 142 of file ksortablelist.h.
Public Member Functions | |
void | insert (Key i, const T &t) |
const T & | operator[] (Key i) const |
T & | operator[] (Key i) |
void | sort () |
Member Function Documentation
template<typename T, typename Key = int>
void KSortableList< T, Key >::insert | ( | Key | i, | |
const T & | t | |||
) | [inline] |
Insert a KSortableItem with the given values.
- Parameters:
-
i the first value t the second value
Definition at line 150 of file ksortablelist.h.
template<typename T, typename Key = int>
const T& KSortableList< T, Key >::operator[] | ( | Key | i | ) | const [inline] |
Returns the first value of the KSortableItem at the given position.
- Returns:
- the first value of the KSortableItem
Definition at line 167 of file ksortablelist.h.
template<typename T, typename Key = int>
T& KSortableList< T, Key >::operator[] | ( | Key | i | ) | [inline] |
Returns the first value of the KSortableItem at the given position.
- Returns:
- the first value of the KSortableItem
Definition at line 159 of file ksortablelist.h.
template<typename T, typename Key = int>
void KSortableList< T, Key >::sort | ( | ) | [inline] |
The documentation for this class was generated from the following file: