.TH "KListViewSearchLine" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KListViewSearchLine \- This class makes it easy to add a search line for filtering the items in a listview based on a simple text search.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <klistviewsearchline.h>\fP
.PP
Inherits \fBKLineEdit\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBupdateSearch\fP (const \fBQString\fP &s=QString::null)"
.br
.ti -1c
.RI "void \fBsetCaseSensitive\fP (bool cs)"
.br
.ti -1c
.RI "void \fBsetKeepParentsVisible\fP (bool v)"
.br
.ti -1c
.RI "void \fBsetSearchColumns\fP (const \fBQValueList\fP< int > &columns)"
.br
.ti -1c
.RI "void \fBsetListView\fP (\fBKListView\fP *lv)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKListViewSearchLine\fP (\fBQWidget\fP *parent=0, \fBKListView\fP *listView=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKListViewSearchLine\fP (\fBQWidget\fP *parent, const char *name)"
.br
.ti -1c
.RI "virtual \fB~KListViewSearchLine\fP ()"
.br
.ti -1c
.RI "bool \fBcaseSensitive\fP () const "
.br
.ti -1c
.RI "\fBQValueList\fP< int > \fBsearchColumns\fP () const "
.br
.ti -1c
.RI "bool \fBkeepParentsVisible\fP () const "
.br
.ti -1c
.RI "\fBKListView\fP * \fBlistView\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBqueueSearch\fP (const \fBQString\fP &search)"
.br
.ti -1c
.RI "void \fBactivateSearch\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBitemMatches\fP (const \fBQListViewItem\fP *item, const \fBQString\fP &s) const "
.br
.ti -1c
.RI "virtual \fBQPopupMenu\fP * \fBcreatePopupMenu\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class makes it easy to add a search line for filtering the items in a listview based on a simple text search. 

No changes to the application other than instantiating this class with an appropriate \fBKListView\fP should be needed.
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 39 of file klistviewsearchline.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KListViewSearchLine::KListViewSearchLine (\fBQWidget\fP * parent = \fC0\fP, \fBKListView\fP * listView = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a KListViewSearchLine with \fIlistView\fP being the \fBKListView\fP to be filtered. 
.PP
If \fIlistView\fP is null then the widget will be disabled until a listview is set with \fBsetListView()\fP. 
.PP
Definition at line 59 of file klistviewsearchline.cpp.
.PP
References listView(), queueSearch(), and QLineEdit::textChanged().
.SS "KListViewSearchLine::KListViewSearchLine (\fBQWidget\fP * parent, const char * name)"
.PP
Constructs a KListViewSearchLine without any \fBKListView\fP to filter. 
.PP
The \fBKListView\fP object has to be set later with \fBsetListView()\fP. 
.PP
Definition at line 80 of file klistviewsearchline.cpp.
.PP
References queueSearch(), and QLineEdit::textChanged().
.SS "KListViewSearchLine::~\fBKListViewSearchLine\fP ()\fC [virtual]\fP"
.PP
Destroys the KListViewSearchLine. 
.PP
Definition at line 93 of file klistviewsearchline.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KListViewSearchLine::caseSensitive () const"
.PP
Returns true if the search is case sensitive. 
.PP
This defaults to false.
.PP
\fBSee also:\fP
.RS 4
\fBsetCaseSensitive()\fP 
.RE
.PP

.PP
Definition at line 98 of file klistviewsearchline.cpp.
.SS "\fBQValueList\fP< int > KListViewSearchLine::searchColumns () const"
.PP
Returns the current list of columns that will be searched. 
.PP
If the returned list is empty all visible columns will be searched.
.PP
\fBSee also:\fP
.RS 4
\fBsetSearchColumns\fP 
.RE
.PP

.PP
Definition at line 103 of file klistviewsearchline.cpp.
.SS "bool KListViewSearchLine::keepParentsVisible () const"
.PP
If this is true (the default) then the parents of matched items will also be shown. 
.PP
\fBSee also:\fP
.RS 4
\fBsetKeepParentsVisible()\fP 
.RE
.PP

.PP
Definition at line 108 of file klistviewsearchline.cpp.
.SS "\fBKListView\fP * KListViewSearchLine::listView () const"
.PP
Returns the listview that is currently filtered by the search. 
.PP
\fBSee also:\fP
.RS 4
\fBsetListView()\fP 
.RE
.PP

.PP
Definition at line 113 of file klistviewsearchline.cpp.
.PP
Referenced by KListViewSearchLine().
.SS "void KListViewSearchLine::updateSearch (const \fBQString\fP & s = \fCQString::null\fP)\fC [virtual, slot]\fP"
.PP
Updates search to only make visible the items that match \fIs\fP. 
.PP
If \fIs\fP is null then the line edit's text will be used. 
.PP
Definition at line 122 of file klistviewsearchline.cpp.
.PP
References QListViewItem::listView(), and QLineEdit::text().
.PP
Referenced by activateSearch().
.SS "void KListViewSearchLine::setCaseSensitive (bool cs)\fC [slot]\fP"
.PP
Make the search case sensitive or case insensitive. 
.PP
\fBSee also:\fP
.RS 4
caseSenstive() 
.RE
.PP

.PP
Definition at line 163 of file klistviewsearchline.cpp.
.SS "void KListViewSearchLine::setKeepParentsVisible (bool v)\fC [slot]\fP"
.PP
When a search is active on a list that's organized into a tree view if a parent or ancesestor of an item is does not match the search then it will be hidden and as such so too will any children that match. 
.PP
If this is set to true (the default) then the parents of matching items will be shown.
.PP
\fBSee also:\fP
.RS 4
\fBkeepParentsVisible\fP 
.RE
.PP

.PP
Definition at line 168 of file klistviewsearchline.cpp.
.SS "void KListViewSearchLine::setSearchColumns (const \fBQValueList\fP< int > & columns)\fC [slot]\fP"
.PP
Sets the list of columns to be searched. 
.PP
The default is to search all, visible columns which can be restored by passing \fIcolumns\fP as an empty list.
.PP
\fBSee also:\fP
.RS 4
\fBsearchColumns\fP 
.RE
.PP

.PP
Definition at line 173 of file klistviewsearchline.cpp.
.SS "void KListViewSearchLine::setListView (\fBKListView\fP * lv)\fC [slot]\fP"
.PP
Sets the \fBKListView\fP that is filtered by this search line. 
.PP
If \fIlv\fP is null then the widget will be disabled.
.PP
\fBSee also:\fP
.RS 4
\fBlistView()\fP 
.RE
.PP

.PP
Definition at line 178 of file klistviewsearchline.cpp.
.PP
References QListViewItem::listView().
.SS "bool KListViewSearchLine::itemMatches (const \fBQListViewItem\fP * item, const \fBQString\fP & s) const\fC [protected, virtual]\fP"
.PP
Returns true if \fIitem\fP matches the search \fIs\fP. 
.PP
This will be evaluated based on the value of \fBcaseSensitive()\fP. This can be overridden in subclasses to implement more complicated matching schemes. 
.PP
Definition at line 205 of file klistviewsearchline.cpp.
.PP
References QValueList::end(), and QValueList::find().
.SS "\fBQPopupMenu\fP * KListViewSearchLine::createPopupMenu ()\fC [protected, virtual]\fP"
.PP
Re-implemented for internal reasons. 
.PP
API not affected.
.PP
See QLineEdit::mousePressEvent(). 
.PP
Reimplemented from \fBKLineEdit\fP.
.PP
Definition at line 234 of file klistviewsearchline.cpp.
.PP
References QString::arg(), QPopupMenu::clear(), KLineEdit::createPopupMenu(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), QString::isEmpty(), QHeader::mapToIndex(), QHeader::mapToSection(), and QPopupMenu::setItemChecked().
.SS "void KListViewSearchLine::queueSearch (const \fBQString\fP & search)\fC [protected, slot]\fP"
.PP
When keys are pressed a new search string is created and a timer is activated. 
.PP
The most recent search is activated when this timer runs out if another key has not yet been pressed.
.PP
This method makes 
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP the most recent search and starts the timer.
.RE
.PP
Together with \fBactivateSearch()\fP this makes it such that searches are not started until there is a short break in the users typing.
.PP
\fBSee also:\fP
.RS 4
\fBactivateSearch()\fP 
.RE
.PP

.PP
Definition at line 284 of file klistviewsearchline.cpp.
.PP
References activateSearch(), and QTimer::singleShot().
.PP
Referenced by KListViewSearchLine().
.SS "void KListViewSearchLine::activateSearch ()\fC [protected, slot]\fP"
.PP
When the timer started with \fBqueueSearch()\fP expires this slot is called. 
.PP
If there has been another timer started then this slot does nothing. However if there are no other pending searches this starts the list view search.
.PP
\fBSee also:\fP
.RS 4
\fBqueueSearch()\fP 
.RE
.PP

.PP
Definition at line 291 of file klistviewsearchline.cpp.
.PP
References updateSearch().
.PP
Referenced by queueSearch().

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