KListViewSearchLine Class Reference
This class makes it easy to add a search line for filtering the items in a listview based on a simple text search. More...
#include <klistviewsearchline.h>
Inheritance diagram for KListViewSearchLine:

Public Slots | |
virtual void | updateSearch (const QString &s=QString::null) |
void | setCaseSensitive (bool cs) |
void | setKeepParentsVisible (bool v) |
void | setSearchColumns (const QValueList< int > &columns) |
void | setListView (KListView *lv) |
Public Member Functions | |
KListViewSearchLine (QWidget *parent=0, KListView *listView=0, const char *name=0) | |
virtual | ~KListViewSearchLine () |
bool | caseSensitive () const |
QValueList< int > | searchColumns () const |
bool | keepParentsVisible () const |
KListView * | listView () const |
Protected Slots | |
void | queueSearch (const QString &search) |
void | activateSearch () |
Protected Member Functions | |
virtual bool | itemMatches (const QListViewItem *item, const QString &s) const |
virtual QPopupMenu * | createPopupMenu () |
Detailed Description
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 KListView should be needed.
- Since:
- 3.3
Definition at line 37 of file klistviewsearchline.h.
Constructor & Destructor Documentation
|
Constructs a KListViewSearchLine with listView being the KListView to be filtered. If listView is null then the widget will be disabled until a listview is set with setListView(). Definition at line 53 of file klistviewsearchline.cpp. References KListViewSearchLine(), and queueSearch(). Referenced by KListViewSearchLine(). |
|
Destroys the KListViewSearchLine.
Definition at line 74 of file klistviewsearchline.cpp. |
Member Function Documentation
|
Returns true if the search is case sensitive. This defaults to false.
Definition at line 79 of file klistviewsearchline.cpp. |
|
Returns the current list of columns that will be searched. If the returned list is empty all columns will be searched.
Definition at line 84 of file klistviewsearchline.cpp. |
|
If this is true (the default) then the parents of matched items will also be shown.
Definition at line 89 of file klistviewsearchline.cpp. |
|
Returns the listview that is currently filtered by the search.
Definition at line 94 of file klistviewsearchline.cpp. |
|
Updates search to only make visible the items that match s. If s is null then the line edit's text will be used. Definition at line 103 of file klistviewsearchline.cpp. References updateSearch(). Referenced by activateSearch(), and updateSearch(). |
|
Make the search case sensitive or case insensitive.
Definition at line 144 of file klistviewsearchline.cpp. References setCaseSensitive(). Referenced by setCaseSensitive(). |
|
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. If this is set to true (the default) then the parents of matching items will be shown.
Definition at line 149 of file klistviewsearchline.cpp. References setKeepParentsVisible(). Referenced by setKeepParentsVisible(). |
|
Sets the list of columns to be searched. The default is to search all, which can be restored by passing columns as an empty list.
Definition at line 154 of file klistviewsearchline.cpp. References setSearchColumns(). Referenced by setSearchColumns(). |
|
Sets the KListView that is filtered by this search line. If lv is null then the widget will be disabled.
Definition at line 159 of file klistviewsearchline.cpp. References setListView(). Referenced by setListView(). |
|
Returns true if item matches the search s. This will be evaluated based on the value of caseSensitive(). This can be overridden in subclasses to implement more complicated matching schemes. Definition at line 186 of file klistviewsearchline.cpp. References itemMatches(). Referenced by itemMatches(). |
|
Re-implemented for internal reasons. API not affected. See QLineEdit::mousePressEvent(). Reimplemented from KLineEdit. Definition at line 212 of file klistviewsearchline.cpp. References KLineEdit::createPopupMenu(). |
|
When keys are pressed a new search string is created and a timer is activated. The most recent search is activated when this timer runs out if another key has not yet been pressed. This method makes
Definition at line 246 of file klistviewsearchline.cpp. References activateSearch(), and queueSearch(). Referenced by KListViewSearchLine(), and queueSearch(). |
|
When the timer started with queueSearch() expires this slot is called. 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.
Definition at line 253 of file klistviewsearchline.cpp. References updateSearch(). Referenced by queueSearch(). |
The documentation for this class was generated from the following files: