• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDECore

Public Member Functions

KSortableList< T, Key > Class Template Reference

KSortableList is a QList which associates a key with each item in the list. More...

#include <KSortableList>

Inherits QList< KSortableItem< T, Key > >.

List of all members.

Public Member Functions

void insert (Key i, const T &t)
T & operator[] (Key i)
const T & operator[] (Key i) const
void sort ()

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 144 of file ksortablelist.h.


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:
ithe first value
tthe second value

Definition at line 152 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 161 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 169 of file ksortablelist.h.

template<typename T, typename Key = int>
void KSortableList< T, Key >::sort ( ) [inline]

Sorts the KSortableItems.

Definition at line 176 of file ksortablelist.h.


The documentation for this class was generated from the following file:
  • ksortablelist.h

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal