.TH "KCompletionMatches" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCompletionMatches \- This structure is returned by \fBKCompletion::allWeightedMatches\fP . List for keeping matches returned from \fBKCompletion\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcompletion.h>\fP
.PP
Inherits \fBKSortableValueList< T, Key >< QString >\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKCompletionMatches\fP (bool sort)"
.br
.ti -1c
.RI "\fBKCompletionMatches\fP (const KCompletionMatchesWrapper &matches)"
.br
.ti -1c
.RI "void \fBremoveDuplicates\fP ()"
.br
.ti -1c
.RI "\fBQStringList\fP \fBlist\fP (bool sort=true) const "
.br
.ti -1c
.RI "bool \fBsorting\fP () const "
.br
.in -1c
.SH "Detailed Description"
.PP 
This structure is returned by \fBKCompletion::allWeightedMatches\fP . List for keeping matches returned from \fBKCompletion\fP. 

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
.PP
Example (a simplified example of what Konqueror's completion does): 
.PP
.nf
 KCompletionMatches matches = completion->allWeightedMatches( location );
 if( !location.startsWith( 'www.' ))
 matches += completion->allWeightedmatches( 'www.' + location' );
 matches.removeDuplicates();
 QStringList list = matches.list();

.fi
.PP

.PP
Definition at line 615 of file kcompletion.h.
.SH "Member Function Documentation"
.PP 
.SS "void KCompletionMatches::removeDuplicates ()"
.PP
Removes duplicate matches. 
.PP
Needed only when you merged several matches results and there's a possibility of duplicates. 
.PP
Definition at line 796 of file kcompletion.cpp.
.PP
References QValueList< KSortableItem< T, Key > >::begin(), QValueList< KSortableItem< T, Key > >::end(), and QValueList< KSortableItem< T, Key > >::remove().
.SS "\fBQStringList\fP KCompletionMatches::list (bool sort = \fCtrue\fP) const"
.PP
Returns the matches as a \fBQStringList\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIsort\fP if false, the matches won't be sorted before the conversion, use only if you're sure the sorting is not needed 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of matches 
.RE
.PP

.PP
Definition at line 785 of file kcompletion.cpp.
.PP
References QValueList< KSortableItem< T, Key > >::begin(), QValueList< KSortableItem< T, Key > >::end(), and QStringList::sort().
.SS "bool KCompletionMatches::sorting () const\fC [inline]\fP"
.PP
If \fBsorting()\fP returns false, the matches aren't sorted by their weight, even if true is passed to \fBlist()\fP. 
.PP
\fBReturns:\fP
.RS 4
true if the matches won't be sorted 
.RE
.PP

.PP
Definition at line 641 of file kcompletion.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
