KCompletionMatches

Search for usage in LXR

KCompletionMatches Class Reference

#include <KCompletionMatches>

Inheritance diagram for KCompletionMatches:

Public Member Functions

 KCompletionMatches (bool sort)
 
 KCompletionMatches (const KCompletionMatches &)
 
 KCompletionMatches (const KCompletionMatchesWrapper &matches)
 
 ~KCompletionMatches ()
 
QStringList list (bool sort=true) const
 
KCompletionMatchesoperator= (const KCompletionMatches &)
 
void removeDuplicates ()
 
bool sorting () const
 
- Public Member Functions inherited from KSortableList< T, Key >
void insert (Key i, const T &t)
 
T & operator[] (Key i)
 
const T & operator[] (Key i) const
 
void sort ()
 
- Public Member Functions inherited from QList< KSortableItem< T, Key > >
 QList (const QList< T > &other)
 
 QList (std::initializer_list< T > args)
 
 QList (InputIterator first, InputIterator last)
 
 QList (QList< T > &&other)
 
void append (const T &value)
 
void append (const QList< 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 T &value) const const
 
int count () 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 pos)
 
QList::iterator erase (QList::iterator begin, QList::iterator end)
 
const T & first () const const
 
T & first ()
 
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)
 
QDataStreamoperator<< (QDataStream &out, const QList< T > &list)
 
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= (QList< T > &&other)
 
QList< T > & operator= (const 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)
 
QDataStreamoperator>> (QDataStream &in, QList< T > &list)
 
const T & operator[] (int i) const const
 
T & operator[] (int i)
 
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::const_reverse_iterator rend () const const
 
QList::reverse_iterator rend ()
 
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)
 
takeAt (int i)
 
takeFirst ()
 
takeLast ()
 
QSet< T > toSet () const const
 
std::list< T > toStdList () const const
 
QVector< T > toVector () const const
 
value (int i) const const
 
value (int i, const T &defaultValue) const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QList< KSortableItem< T, Key > >
QList< T > fromSet (const QSet< T > &set)
 
QList< T > fromStdList (const std::list< T > &list)
 
QList< T > fromVector (const QVector< T > &vector)
 
- Public Attributes inherited from QList< KSortableItem< T, Key > >
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

This structure is returned by KCompletion::allWeightedMatches().

It also keeps the weight of the matches, allowing you to modify some matches or merge them with matches from another call to allWeightedMatches(), and sort the matches after that in order to have the matches ordered correctly.

Example (a simplified example of what Konqueror's completion does):

KCompletionMatches matches = completion->allWeightedMatches(location);
if(!location.startsWith("www."))
matches += completion->allWeightedmatches("www." + location");
matches.removeDuplicates();
QStringList list = matches.list();

List for keeping matches returned from KCompletion

Definition at line 42 of file kcompletionmatches.h.

Constructor & Destructor Documentation

KCompletionMatches::KCompletionMatches ( bool  sort)

Default constructor.

Parameters
sortif false, the matches won't be sorted before the conversion, use only if you're sure the sorting is not needed

Definition at line 47 of file kcompletionmatches.cpp.

KCompletionMatches::KCompletionMatches ( const KCompletionMatches o)

copy constructor.

Definition at line 28 of file kcompletionmatches.cpp.

KCompletionMatches::KCompletionMatches ( const KCompletionMatchesWrapper &  matches)

Definition at line 52 of file kcompletionmatches.cpp.

KCompletionMatches::~KCompletionMatches ( )

default destructor.

Definition at line 65 of file kcompletionmatches.cpp.

Member Function Documentation

QStringList KCompletionMatches::list ( bool  sort = true) const

Returns the matches as a QStringList.

Parameters
sortif false, the matches won't be sorted before the conversion, use only if you're sure the sorting is not needed
Returns
the list of matches

Definition at line 69 of file kcompletionmatches.cpp.

KCompletionMatches & KCompletionMatches::operator= ( const KCompletionMatches o)

assignment operator.

Definition at line 35 of file kcompletionmatches.cpp.

void KCompletionMatches::removeDuplicates ( )

Removes duplicate matches.

Needed only when you merged several matches results and there's a possibility of duplicates.

Definition at line 89 of file kcompletionmatches.cpp.

bool KCompletionMatches::sorting ( ) const

If sorting() returns false, the matches aren't sorted by their weight, even if true is passed to list().

Returns
true if the matches won't be sorted

Definition at line 83 of file kcompletionmatches.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Apr 20 2021 22:51:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.