KSortableItem Class

template <typename T, typename Key = int> class KSortableItem

KSortableItem is a QPair that provides several operators for sorting. More...

Header: #include <KSortableList>
CMake: find_package(KF6 REQUIRED COMPONENTS Completion)
target_link_libraries(mytarget PRIVATE KF6::Completion)

Public Functions

KSortableItem()
KSortableItem(Key i, const T &t)
KSortableItem(const KSortableItem<T, Key> &rhs)
Key key() const
T &value()
const T &value() const
bool operator!=(const KSortableItem<T, Key> &i2) const
bool operator<(const KSortableItem<T, Key> &i2) const
bool operator<=(const KSortableItem<T, Key> &i2) const
KSortableItem<T, Key> &operator=(const KSortableItem<T, Key> &i)
bool operator==(const KSortableItem<T, Key> &i2) const
bool operator>(const KSortableItem<T, Key> &i2) const
bool operator>=(const KSortableItem<T, Key> &i2) const

Detailed Description

See also KSortableList.

Member Function Documentation

KSortableItem::KSortableItem()

Creates a new KSortableItem with uninitialized values.

KSortableItem::KSortableItem(Key i, const T &t)

Creates a new KSortableItem with the given values.

i the first value (the key)

t the second value (the item)

KSortableItem::KSortableItem(const KSortableItem<T, Key> &rhs)

Creates a new KSortableItem that copies another one.

rhs the other item to copy

Key KSortableItem::key() const

Returns the first value.

T &KSortableItem::value()

Returns the second value (the item)

const T &KSortableItem::value() const

Returns the second value (the item)

bool KSortableItem::operator!=(const KSortableItem<T, Key> &i2) const

Compares the two items. This implementation only compares the first value.

bool KSortableItem::operator<(const KSortableItem<T, Key> &i2) const

Compares the two items. This implementation only compares the first value.

bool KSortableItem::operator<=(const KSortableItem<T, Key> &i2) const

Compares the two items. This implementation only compares the first value.

KSortableItem<T, Key> &KSortableItem::operator=(const KSortableItem<T, Key> &i)

Assignment operator, just copies the item.

bool KSortableItem::operator==(const KSortableItem<T, Key> &i2) const

Compares the two items. This implementation only compares the first value.

bool KSortableItem::operator>(const KSortableItem<T, Key> &i2) const

Compares the two items. This implementation only compares the first value.

bool KSortableItem::operator>=(const KSortableItem<T, Key> &i2) const

Compares the two items. This implementation only compares the first value.