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

KDEUI

Public Member Functions
KCompletionMatches Class Reference

#include <kcompletion.h>

Inheritance diagram for KCompletionMatches:
KSortableList< T, Key >

List of all members.

Public Member Functions

 KCompletionMatches (bool sort)
 KCompletionMatches (const KCompletionMatches &)
 KCompletionMatches (const KCompletionMatchesWrapper &matches)
 ~KCompletionMatches ()
QStringList list (bool sort=true) const
KCompletionMatches & operator= (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 ()

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 579 of file kcompletion.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 859 of file kcompletion.cpp.

KCompletionMatches::KCompletionMatches ( const KCompletionMatches &  o)

copy constructor.

Definition at line 842 of file kcompletion.cpp.

KCompletionMatches::KCompletionMatches ( const KCompletionMatchesWrapper &  matches)

Definition at line 864 of file kcompletion.cpp.

KCompletionMatches::~KCompletionMatches ( )

default destructor.

Definition at line 878 of file kcompletion.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 883 of file kcompletion.cpp.

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

assignment operator.

Definition at line 849 of file kcompletion.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 899 of file kcompletion.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 894 of file kcompletion.cpp.


The documentation for this class was generated from the following files:
  • kcompletion.h
  • kcompletion.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 17:49:44 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal