KSortableList
#include <KSortableList>

Public Member Functions | |
void | insert (Key i, const T &t) |
T & | operator[] (Key i) |
const T & | operator[] (Key i) const |
void | sort () |
![]() | |
QList (const QList< T > &other) | |
QList (InputIterator first, InputIterator last) | |
QList (QList< T > &&other) | |
QList (std::initializer_list< T > args) | |
void | append (const QList< T > &value) |
void | append (const T &value) |
const T & | at (int i) const const |
T & | back () |
const T & | back () const const |
QList::iterator | begin () |
QList::const_iterator | begin () const const |
QList::const_iterator | cbegin () const const |
QList::const_iterator | cend () const const |
void | clear () |
QList::const_iterator | constBegin () const const |
QList::const_iterator | constEnd () const const |
const T & | constFirst () const const |
const T & | constLast () const const |
bool | contains (const T &value) const const |
int | count () const const |
int | count (const T &value) const const |
QList::const_reverse_iterator | crbegin () const const |
QList::const_reverse_iterator | crend () const const |
bool | empty () const const |
QList::iterator | end () |
QList::const_iterator | end () const const |
bool | endsWith (const T &value) const const |
QList::iterator | erase (QList::iterator begin, QList::iterator end) |
QList::iterator | erase (QList::iterator pos) |
T & | first () |
const T & | first () const const |
T & | front () |
const T & | front () const const |
int | indexOf (const T &value, int from) const const |
void | insert (int i, const T &value) |
QList::iterator | insert (QList::iterator before, const T &value) |
bool | isEmpty () const const |
T & | last () |
const T & | last () const const |
int | lastIndexOf (const T &value, int from) const const |
int | length () const const |
QList< T > | mid (int pos, int length) const const |
void | move (int from, int to) |
bool | operator!= (const QList< T > &other) const const |
QList< T > | operator+ (const QList< T > &other) const const |
QList< T > & | operator+= (const QList< T > &other) |
QList< T > & | operator+= (const T &value) |
bool | operator< (const QList< T > &lhs, const QList< T > &rhs) |
QList< T > & | operator<< (const QList< T > &other) |
QList< T > & | operator<< (const T &value) |
QDataStream & | operator<< (QDataStream &out, const QList< T > &list) |
bool | operator<= (const QList< T > &lhs, const QList< T > &rhs) |
QList< T > & | operator= (const QList< T > &other) |
QList< T > & | operator= (QList< T > &&other) |
bool | operator== (const QList< T > &other) const const |
bool | operator> (const QList< T > &lhs, const QList< T > &rhs) |
bool | operator>= (const QList< T > &lhs, const QList< T > &rhs) |
QDataStream & | operator>> (QDataStream &in, QList< T > &list) |
T & | operator[] (int i) |
const T & | operator[] (int i) const const |
void | pop_back () |
void | pop_front () |
void | prepend (const T &value) |
void | push_back (const T &value) |
void | push_front (const T &value) |
uint | qHash (const QList< T > &key, uint seed) |
QList::reverse_iterator | rbegin () |
QList::const_reverse_iterator | rbegin () const const |
int | removeAll (const T &value) |
void | removeAt (int i) |
void | removeFirst () |
void | removeLast () |
bool | removeOne (const T &value) |
QList::reverse_iterator | rend () |
QList::const_reverse_iterator | rend () const const |
void | replace (int i, const T &value) |
void | reserve (int alloc) |
int | size () const const |
bool | startsWith (const T &value) const const |
void | swap (int i, int j) |
void | swap (QList< T > &other) |
void | swapItemsAt (int i, int j) |
T | takeAt (int i) |
T | takeFirst () |
T | takeLast () |
QSet< T > | toSet () const const |
std::list< T > | toStdList () const const |
QVector< T > | toVector () const const |
T | value (int i) const const |
T | value (int i, const T &defaultValue) const const |
Additional Inherited Members | |
![]() | |
QList< T > | fromSet (const QSet< T > &set) |
QList< T > | fromStdList (const std::list< T > &list) |
QList< T > | fromVector (const QVector< T > &vector) |
![]() | |
typedef | const_pointer |
typedef | const_reference |
typedef | const_reverse_iterator |
typedef | ConstIterator |
typedef | difference_type |
typedef | Iterator |
typedef | pointer |
typedef | reference |
typedef | reverse_iterator |
typedef | size_type |
typedef | value_type |
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 160 of file ksortablelist.h.
Member Function Documentation
◆ insert()
|
inline |
Insert a KSortableItem with the given values.
- Parameters
-
i the first value t the second value
Definition at line 168 of file ksortablelist.h.
◆ operator[]() [1/2]
|
inline |
Returns the first value of the KSortableItem at the given position.
- Returns
- the first value of the KSortableItem
Definition at line 178 of file ksortablelist.h.
◆ operator[]() [2/2]
|
inline |
Returns the first value of the KSortableItem at the given position.
- Returns
- the first value of the KSortableItem
Definition at line 187 of file ksortablelist.h.
◆ sort()
|
inline |
Sorts the KSortableItems.
Definition at line 195 of file ksortablelist.h.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 16 2022 04:07:35 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.